* [task#129030,done,1.5h] convert special characters to HTML entities.

This commit is contained in:
tianshujie
2024-10-09 09:08:46 +08:00
committed by 刘刚
parent c7112c52bc
commit d7d98d85d9
2 changed files with 3 additions and 1 deletions
-1
View File
@@ -304,7 +304,6 @@ class searchModel extends model
/* Decode html encode. */
$query->form = htmlspecialchars_decode($query->form, ENT_QUOTES);
$query->sql = htmlspecialchars_decode($query->sql, ENT_QUOTES);
/* 如果搜索表单中值有变量,把表单值放到post 表单,重新生成 query。*/
/* If form has variable, regenerate query. */
+3
View File
@@ -185,6 +185,9 @@ class searchTao extends searchModel
*/
protected function setCondition(string $field, string $operator, string|int $value, string $control = ''): string
{
/* 替换特殊字符。 */
if(is_string($value)) $value = htmlspecialchars($value, ENT_QUOTES);
$condition = '';
if($operator == 'include')
{