Skip to content

Commit

Permalink
Für PHP5.5: preg_replace() durch preg_replace_callback() ersetzt; Cha…
Browse files Browse the repository at this point in the history
…ngelog angepasst
  • Loading branch information
ubruhin committed Mar 16, 2014
1 parent 01c25ed commit b0790c0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
6 changes: 4 additions & 2 deletions lib/vlib/vlibTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
38 changes: 19 additions & 19 deletions lib/vlib/vlibTemplate/debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]
);
}
}
Expand Down Expand Up @@ -602,4 +602,4 @@ function recache() {}
function setCacheLifeTime() {}
function setCacheExtension() {}
}
?>
?>
7 changes: 4 additions & 3 deletions readme/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
=============
Expand Down

0 comments on commit b0790c0

Please sign in to comment.