update application/common/library/SelectPage.php.

新selectpage类中验证字段名是否在允许列表中的方法只验证了数据库表字段,并未验证模型中追加的属性,若要获取模型追加的属性会报参数错误

Signed-off-by: 还俗二师兄 <505097558@qq.com>
pull/528/head
还俗二师兄 2026-05-28 01:03:10 +00:00 committed by Gitee
parent b430f058a9
commit 430ee98ab1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -221,7 +221,7 @@ class SelectPage
protected function validateField(string $field) protected function validateField(string $field)
{ {
$field = strtolower($field); $field = strtolower($field);
if (!in_array($field, $this->allowedFields, true)) { if (!in_array($field, $this->allowedFields, true) && !in_array($field, $this->resolveSelectpageFields(), true)) {
throw new Exception('Invalid parameters'); throw new Exception('Invalid parameters');
} }
} }