Skip to content

Commit d091052

Browse files
committed
Merge pull request chrisboulton#1 from PhilETaylor/PhilETaylor-PHP7Compatibility
PHP7 Compatibility - remove preg_match with /e modifier
2 parents f4db229 + da175e0 commit d091052

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Diff/Renderer/Html/Array.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ protected function formatLines($lines)
177177
$lines = array_map(array($this, 'ExpandTabs'), $lines);
178178
$lines = array_map(array($this, 'HtmlSafe'), $lines);
179179
foreach($lines as &$line) {
180-
$line = preg_replace('# ( +)|^ #e', "\$this->fixSpaces('\\1')", $line);
180+
$line = preg_replace_callback('# ( +)|^ #is',
181+
function ($m) {
182+
return $this->fixSpaces($m[1]);
183+
},
184+
$line);
181185
}
182186
return $lines;
183187
}

0 commit comments

Comments
 (0)