diff --git a/lib/Diff/Renderer/Html/Array.php b/lib/Diff/Renderer/Html/Array.php
index b012fb6b..89ca016e 100644
--- a/lib/Diff/Renderer/Html/Array.php
+++ b/lib/Diff/Renderer/Html/Array.php
@@ -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;
}
@@ -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 '';
@@ -222,3 +223,4 @@ private function htmlSafe($string)
return htmlspecialchars($string, ENT_NOQUOTES, 'UTF-8');
}
}
+