Skip to content

Commit

Permalink
tp6的优化过滤函数,兼容php8.1;
Browse files Browse the repository at this point in the history
  • Loading branch information
augushong authored and liu21st committed Feb 20, 2022
1 parent a33d884 commit 473230a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/think/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,11 @@ private function filterValue(&$value, $key, $filters)
foreach ($filters as $filter) {
if (is_callable($filter)) {
// 调用函数或者方法过滤

if(is_null($value)) {
continue;
}

$value = call_user_func($filter, $value);
} elseif (is_scalar($value)) {
if (false !== strpos($filter, '/')) {
Expand Down

0 comments on commit 473230a

Please sign in to comment.