From ebea2ee3455d43677b35356a605db70e22d87c02 Mon Sep 17 00:00:00 2001 From: liwenrui Date: Thu, 13 Jul 2023 14:24:20 +0800 Subject: [PATCH] * use is_numeric cause is_int wont work properly on strings. --- module/ai/model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/ai/model.php b/module/ai/model.php index 56b7364952..b097d2c5ac 100644 --- a/module/ai/model.php +++ b/module/ai/model.php @@ -453,7 +453,7 @@ class aiModel extends model */ public function togglePromptStatus($prompt, $status = '') { - if(is_int($prompt)) $prompt = $this->getPromptById($prompt); + if(is_numeric($prompt)) $prompt = $this->getPromptById($prompt); if(empty($prompt)) return false; $flipedStatus = $prompt->status == 'draft' ? 'active' : 'draft'; @@ -720,7 +720,7 @@ class aiModel extends model */ public function executePrompt($prompt, $objectId) { - if(is_int($prompt)) $prompt = $this->getPromptById($prompt); + if(is_numeric($prompt)) $prompt = $this->getPromptById($prompt); if(empty($prompt)) return false; $objectData = $this->getObjectForPromptById($prompt, $objectId); @@ -744,7 +744,7 @@ class aiModel extends model */ public function isExecutable($prompt) { - if(is_int($prompt)) $prompt = $this->getByID($prompt); + if(is_numeric($prompt)) $prompt = $this->getByID($prompt); if(empty($prompt)) return false; $executable = true; @@ -800,7 +800,7 @@ class aiModel extends model */ public function getTargetFormLocation($prompt, $objectId) { - if(is_int($prompt)) $prompt = $this->getByID($prompt); + if(is_numeric($prompt)) $prompt = $this->getByID($prompt); if(empty($prompt)) return false; $targetForm = $prompt->targetForm;