mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-04 00:24:29 +08:00
兼容PHP8.1
This commit is contained in:
@@ -13,5 +13,5 @@ namespace app;
|
|||||||
|
|
||||||
class Request extends \think\Request
|
class Request extends \think\Request
|
||||||
{
|
{
|
||||||
|
protected $filter = ['ua_htmlspecialchars'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ function save_url_file($url, $type)
|
|||||||
|
|
||||||
$model_file->save_name = $save_name;
|
$model_file->save_name = $save_name;
|
||||||
$model_file->save();
|
$model_file->save();
|
||||||
|
unlink($temp_file);
|
||||||
return $save_name;
|
return $save_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,3 +276,28 @@ function app_url(string $url = '', array $vars = [], $suffix = true, $domain = f
|
|||||||
|
|
||||||
return url($url, $vars, $suffix, $domain);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,4 +22,6 @@ return [
|
|||||||
'taglib_begin' => '{',
|
'taglib_begin' => '{',
|
||||||
// 标签库标签结束标记
|
// 标签库标签结束标记
|
||||||
'taglib_end' => '}',
|
'taglib_end' => '}',
|
||||||
|
|
||||||
|
'default_filter' => 'ua_htmlentities', // 默认过滤方法 用于普通标签输出
|
||||||
];
|
];
|
||||||
|
|||||||
2
runtime/.gitignore
vendored
2
runtime/.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
||||||
Reference in New Issue
Block a user