From da175e07da7919d88d1d35ab5c8a9e089815e5ce Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Tue, 15 Dec 2015 19:56:21 +0000 Subject: [PATCH] PHP7 Compatibility - remove preg_match with /e modifier --- lib/Diff/Renderer/Html/Array.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Diff/Renderer/Html/Array.php b/lib/Diff/Renderer/Html/Array.php index b012fb6b..ac72a499 100644 --- a/lib/Diff/Renderer/Html/Array.php +++ b/lib/Diff/Renderer/Html/Array.php @@ -177,7 +177,11 @@ 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('# ( +)|^ #is', + function ($m) { + return $this->fixSpaces($m[1]); + }, + $line); } return $lines; }