Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/Diff/Renderer/Html/Array.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ protected function formatLines($lines)
$lines = array_map(array($this, 'ExpandTabs'), $lines);
$lines = array_map(array($this, 'HtmlSafe'), $lines);
foreach($lines as &$line) {
$line = preg_replace('# ( +)|^ #e', "\$this->fixSpaces('\\1')", $line);
$line= preg_replace_callback('# ( +)|^ #', array($this,'fixSpaces'), $line);
}
return $lines;
}
Expand All @@ -188,8 +188,9 @@ protected function formatLines($lines)
* @param string $spaces The string of spaces.
* @return string The HTML representation of the string.
*/
function fixSpaces($spaces='')
function fixSpaces($matches)
{
$spaces=$matches[1];
$count = strlen($spaces);
if($count == 0) {
return '';
Expand Down Expand Up @@ -222,3 +223,4 @@ private function htmlSafe($string)
return htmlspecialchars($string, ENT_NOQUOTES, 'UTF-8');
}
}