From 8f2bbbaba46366f024ede3854226e6830e68bd45 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 25 Aug 2023 10:20:40 +0800 Subject: [PATCH] * Fix bug #37561. --- lib/base/dao/dao.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index 8da5ef9d98..1edae05c68 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -1925,7 +1925,7 @@ class baseSQL } else { - $condition = ctype_alnum($arg1) ? '`' . $arg1 . '`' : $arg1; + $condition = (is_string($arg1) && ctype_alnum($arg1)) ? '`' . $arg1 . '`' : $arg1; } if(!$this->inMark) $this->sql .= ' ' . DAO::WHERE ." $condition "; @@ -1944,7 +1944,7 @@ class baseSQL public function andWhere($condition, $addMark = false) { if($this->inCondition and !$this->conditionIsTrue) return $this; - if(ctype_alnum($condition)) $condition = '`' . $condition . '`'; + if(is_string($condition) && ctype_alnum($condition)) $condition = '`' . $condition . '`'; $mark = $addMark ? '(' : ''; $this->sql .= " AND {$mark} $condition "; @@ -1962,7 +1962,7 @@ class baseSQL public function orWhere($condition) { if($this->inCondition and !$this->conditionIsTrue) return $this; - if(ctype_alnum($condition)) $condition = '`' . $condition . '`'; + if(is_string($condition) && ctype_alnum($condition)) $condition = '`' . $condition . '`'; $this->sql .= " OR $condition "; return $this;