Skip to content

Commit

Permalink
Update jTemplate.class.php
Browse files Browse the repository at this point in the history
Templates processing fix
  • Loading branch information
sergejey committed Jul 17, 2021
1 parent f776079 commit 1728ddf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/jTemplate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public function parseGlobals(&$res, &$hash)
if (defined($matches[1][$i])) {
$res = str_replace($matches[0][$i], constant($matches[1][$i]), $res);
} else {
if (!isset($hash[$matches[1][$i]])) $hash[$matches[1][$i]]='';
if (!isset($hash[$matches[1][$i]])) $hash[$matches[1][$i]]=null;
$res = str_replace($matches[0][$i], $hash[$matches[1][$i]], $res);
}
}
Expand All @@ -355,7 +355,7 @@ public function parseArrays(&$res, &$hash, $dir)
$count_matches_0 = count($matches[0]);

for ($i = 0; $i < $count_matches_0; $i++) {
if (!isset($hash[$matches[1][$i]])) $hash[$matches[1][$i]]='';
if (!isset($hash[$matches[1][$i]])) $hash[$matches[1][$i]]=null;
$var = $hash[$matches[1][$i]];
$line1 = $matches[2][$i];
$res1 = "";
Expand Down Expand Up @@ -456,7 +456,7 @@ public function parseHashes(&$res, &$hash)
if (preg_match_all('/<#(\w+?)\.(\w+?)#>/', $res, $matches, PREG_PATTERN_ORDER)) {
$count_matches_1 = count($matches[1]);
for ($i = 0; $i < $count_matches_1; $i++) {
if (!isset($hash[$matches[1][$i]][$matches[2][$i]])) $hash[$matches[1][$i]][$matches[2][$i]]='';
if (!isset($hash[$matches[1][$i]][$matches[2][$i]])) $hash[$matches[1][$i]][$matches[2][$i]]=null;
$res = str_replace($matches[0][$i], $this->templateSafe($hash[$matches[1][$i]][$matches[2][$i]]), $res);
}
}
Expand Down

0 comments on commit 1728ddf

Please sign in to comment.