Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Fix the versions diff viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Sep 26, 2013
1 parent cb375c9 commit f8b8348
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions system/modules/core/classes/Versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ public function compare()

$GLOBALS['TL_CONFIG']['debugMode'] = false;
$objTemplate->output();

exit;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ private 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);
// PATCH: use preg_replace_callback instead of /e
$line = preg_replace_callback('# ( +)|^ #', array($this, 'fixSpaces'), $line);
}
return $lines;
}
Expand All @@ -190,6 +191,12 @@ private function formatLines($lines)
*/
function fixSpaces($spaces='')
{
// PATCH: preg_replace_callback will pass an array as argument
if (is_array($spaces)) {
$spaces = $spaces[0];
}
// PATCH EOF

$count = strlen($spaces);
if($count == 0) {
return '';
Expand Down

0 comments on commit f8b8348

Please sign in to comment.