From b0790c05f1ed70da0d771a6ea1a46711120efab8 Mon Sep 17 00:00:00 2001 From: kami89 Date: Sun, 16 Mar 2014 14:12:01 +0100 Subject: [PATCH] =?UTF-8?q?F=C3=BCr=20PHP5.5:=20preg=5Freplace()=20durch?= =?UTF-8?q?=20preg=5Freplace=5Fcallback()=20ersetzt;=20Changelog=20angepas?= =?UTF-8?q?st?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/vlib/vlibTemplate.php | 6 ++++-- lib/vlib/vlibTemplate/debug.php | 38 ++++++++++++++++----------------- readme/changelog.txt | 7 +++--- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/lib/vlib/vlibTemplate.php b/lib/vlib/vlibTemplate.php index 19e62a8e..3dc9040c 100755 --- a/lib/vlib/vlibTemplate.php +++ b/lib/vlib/vlibTemplate.php @@ -967,8 +967,10 @@ function _getData ($tmplfile, $do_eval=false) { $regex.= '[\"\']?'; $regex.= ')?\s*'; $regex.= '(?:>|\/>|}|-->){1}'; - $regex.= '/ie'; - $data = preg_replace($regex,"\$this->_parseTag(array('\\0','\\1','\\2','\\3','\\4','\\5','\\6','\\7','\\8'));",$data); + $regex.= '/i'; + + $obj = $this; // for compatibility with PHP versions before 5.4 + $data = preg_replace_callback($regex, function($m) use($obj) {return $obj->_parseTag($m);}, $data); if ($this->_cache) { // add cache if need be $this->_createCache($data); diff --git a/lib/vlib/vlibTemplate/debug.php b/lib/vlib/vlibTemplate/debug.php index 317ec775..5a7a0c75 100755 --- a/lib/vlib/vlibTemplate/debug.php +++ b/lib/vlib/vlibTemplate/debug.php @@ -302,27 +302,27 @@ function doDebugWarnings ($data, $filename) { $regex.= '[\"\']?'; $regex.= ')?\s*'; $regex.= '(?:>|\/>|}|-->){1}'; - $regex.= '/ie'; + $regex.= '/i'; + + $obj = $this; // for compatibility with PHP versions before 5.4 for ($i = 0; $i < count($data); $i++) { - $file = preg_replace( + $file = preg_replace_callback( $regex, - "\$this->arrangeTags(array( - 'tag' => strtolower('\\2'), - 'paramname1' => strtolower('\\3'), - 'paramval1' => strtolower('\\4'), - 'paramname2' => strtolower('\\5'), - 'paramval2' => strtolower('\\6'), - 'paramname3' => strtolower('\\7'), - 'paramval3' => strtolower('\\8'), - 'openclose' => '\\1', - 'file' => realpath('$filename'), - 'line' => ".($i+1).", - 'entire_tag' => '\\0') - );" - , - - $data[$i] + function($m) use($obj) {return $obj->arrangeTags( + array( 'tag' => strtolower($m[2]), + 'paramname1' => strtolower($m[3]), + 'paramval1' => strtolower($m[4]), + 'paramname2' => strtolower($m[5]), + 'paramval2' => strtolower($m[6]), + 'paramname3' => strtolower($m[7]), + 'paramval3' => strtolower($m[8]), + 'openclose' => $m[1], + 'file' => realpath($filename), + 'line' => ($i+1), + 'entire_tag' => $m[0])); + }, + $data[$i] ); } } @@ -602,4 +602,4 @@ function recache() {} function setCacheLifeTime() {} function setCacheExtension() {} } -?> \ No newline at end of file +?> diff --git a/readme/changelog.txt b/readme/changelog.txt index 82b7f0ef..5b1327fd 100644 --- a/readme/changelog.txt +++ b/readme/changelog.txt @@ -8,13 +8,14 @@ Part-DB 0.3.1 ============= - Bugfixes: - - Issue #25: Bei zu vielen fehlerhaften Footprints unter Bearbeiten->Footprints konnte es + - Issue #25: Bei zu vielen fehlerhaften Footprints unter Bearbeiten->Footprints konnte es zu einer leeren oder nicht richtig funktionierenden Seite führen - - Fehler beim Lesen von Dateirechten haben die Installation auf einigen PHP Installationen + - Fehler beim Lesen von Dateirechten haben die Installation auf einigen PHP Installationen verunmöglicht - + - Sonstiges: - Umstellung von SVN auf Git (RSS-Feed auf Startseite angepasst, diverse Links angepasst) + - Kompatibilität mit PHP 5.5 verbessert Part-DB 0.3.0 =============