兼容PHP8.1

This commit is contained in:
2022-07-21 09:41:22 +08:00
parent d9b337629f
commit da8b9b5e30
4 changed files with 29 additions and 4 deletions

View File

@@ -13,5 +13,5 @@ namespace app;
class Request extends \think\Request
{
protected $filter = ['ua_htmlspecialchars'];
}

View File

@@ -129,7 +129,7 @@ function save_url_file($url, $type)
$model_file->save_name = $save_name;
$model_file->save();
unlink($temp_file);
return $save_name;
}
@@ -276,3 +276,28 @@ function app_url(string $url = '', array $vars = [], $suffix = true, $domain = f
return url($url, $vars, $suffix, $domain);
}
if (!function_exists('ua_htmlspecialchars')) {
function ua_htmlspecialchars($string)
{
if (is_null($string)) {
$string = '';
}
return htmlspecialchars($string);
}
}
if (!function_exists('ua_htmlentities')) {
function ua_htmlentities($string)
{
if (is_null($string)) {
$string = '';
}
return htmlentities($string);
}
}