From 0109f278aa3eee6eb4a10b401dc6818bc01095b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=87=91=E5=8B=87?= Date: Mon, 29 Dec 2025 14:00:50 +0800 Subject: [PATCH] * [apiv2] Check object exists. --- framework/api/router.class.php | 4 +++- www/api.php | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/api/router.class.php b/framework/api/router.class.php index 35848b579a..209d3ad4d5 100644 --- a/framework/api/router.class.php +++ b/framework/api/router.class.php @@ -429,6 +429,8 @@ class api extends router 'testcaseID' => TABLE_CASE, 'user' => TABLE_USER, 'userID' => TABLE_USER, + 'ticket' => TABLE_TICKET, + 'ticketID' => TABLE_TICKET, ]; $params = array_merge($this->params, $_POST); @@ -436,7 +438,7 @@ class api extends router { if(isset($objectMap[$key]) && $value != 0) { - $id = $this->dao->select('id')->from($objectMap[$key])->where('id')->eq($value)->fetch('id'); + $id = $this->dao->select('id')->from($objectMap[$key])->where('id')->eq($value)->andWhere('deleted')->eq('0')->fetch('id'); if(!$id) return $this->control->sendError(ucfirst(str_replace('ID', '', $key)) . ' does not exist.'); } } diff --git a/www/api.php b/www/api.php index 1cd47d0d96..4175466984 100644 --- a/www/api.php +++ b/www/api.php @@ -13,6 +13,7 @@ */ /* Set the error reporting. */ error_reporting(0); +ini_set('zlib.output_compression', 'Off'); /* Start output buffer. */ ob_start();