php-diff: fix callback for newer PHP versions
This commit is contained in:
parent
505d3434a2
commit
204f4a662b
|
@ -176,12 +176,19 @@ class Diff_Renderer_Html_Array extends Diff_Renderer_Abstract
|
|||
{
|
||||
$lines = array_map(array($this, 'ExpandTabs'), $lines);
|
||||
$lines = array_map(array($this, 'HtmlSafe'), $lines);
|
||||
$callback = array($this, 'fixMatchedSpaces');
|
||||
foreach($lines as &$line) {
|
||||
$line = preg_replace('# ( +)|^ #e', "\$this->fixSpaces('\\1')", $line);
|
||||
// $line = preg_replace('# ( +)|^ #e', "\$this->fixSpaces('\\1')", $line);
|
||||
$line = preg_replace_callback('# ( +)|^ #', $callback, $line);
|
||||
}
|
||||
return $lines;
|
||||
}
|
||||
|
||||
protected function fixMatchedSpaces($m)
|
||||
{
|
||||
return $this->fixSpaces($m[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace a string containing spaces with a HTML representation using .
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue