Skip to content

Commit

Permalink
Merge pull request #23 from 9007967/patch-3
Browse files Browse the repository at this point in the history
修复php 8及以上强类型htmlentities函数导致异常问题
  • Loading branch information
liu21st authored Apr 7, 2023
2 parents 4352d2c + 793166f commit 672b131
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,9 @@ public function parseVarFunction(string &$varStr, bool $autoescape = true): stri
switch (strtolower($fun)) {
case 'raw':
break;
case 'htmlentities':
$name = 'htmlentities((string) ' . $name . ')';
break;
case 'date':
$name = 'date(' . $args[1] . ',!is_numeric(' . $name . ')? strtotime(' . $name . ') : ' . $name . ')';
break;
Expand Down

0 comments on commit 672b131

Please sign in to comment.