Skip to content

Commit d6aadf8

Browse files
author
Marius Cramer
committed
Fixed: tpl class now accepts 4 parameters instead of 3 in tags
1 parent 08462d0 commit d6aadf8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

server/lib/classes/tpl.inc.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,16 @@ function _getData ($tmplfile, $do_eval=false) {
962962
$regex.= '[^\"\']*|[a-z0-9_\.]*)';
963963
$regex.= '[\"\']?';
964964
$regex.= ')?\s*';
965+
$regex.= '(?:';
966+
$regex.= '(?:';
967+
$regex.= '(name|format|escape|op|value)';
968+
$regex.= '\s*=\s*';
969+
$regex.= ')';
970+
$regex.= '(?:[\"\'])?';
971+
$regex.= '((?<=[\"\'])';
972+
$regex.= '[^\"\']*|[a-z0-9_\.]*)';
973+
$regex.= '[\"\']?';
974+
$regex.= ')?\s*';
965975
$regex.= '(?:>|\/>|}|-->){1}';
966976
$regex.= '/i';
967977
//$regex.= '([\r\n|\n|\r])?/ie';
@@ -1290,7 +1300,7 @@ function _parseTag ($args) {
12901300
$wholetag = $args[0];
12911301
$openclose = $args[1];
12921302
$tag = strtolower($args[2]);
1293-
$newline = $args[9];
1303+
$newline = $args[11];
12941304
//echo "1#$newline#2";
12951305

12961306
if ($tag == 'else') return '<?php } else { ?>'.$newline;
@@ -1307,7 +1317,7 @@ function _parseTag ($args) {
13071317
}
13081318

13091319
// arrange attributes
1310-
for ($i=3; $i < 8; $i=($i+2)) {
1320+
for ($i=3; $i < 10; $i=($i+2)) {
13111321
if (empty($args[$i]) && empty($args[($i+1)])) break;
13121322
$key = (empty($args[$i])) ? 'name' : strtolower($args[$i]);
13131323
if ($key == 'name' && preg_match('/^(php)?include$/', $tag)) $key = 'file';

0 commit comments

Comments
 (0)