From e3065ca3a0279bd695e9025f8fec5e7cdaf5c3b7 Mon Sep 17 00:00:00 2001 From: towser Date: Fri, 6 Dec 2013 16:04:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?limit=E8=AF=AD=E5=8F=A5=E7=BB=84=E8=A3=85?= =?UTF-8?q?=E6=97=B6=E5=B0=91=E4=BA=86=E4=B8=AA=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doitphp/core/Model.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doitphp/core/Model.class.php b/doitphp/core/Model.class.php index e047f64..c09c022 100644 --- a/doitphp/core/Model.class.php +++ b/doitphp/core/Model.class.php @@ -1061,7 +1061,7 @@ protected function _parseLimit($startId = null, $listNum = null) { } } - $limitString = "LIMIT" . (($listNum) ? "{$startId},{$listNum}" : $startId); + $limitString = "LIMIT " . (($listNum) ? "{$startId},{$listNum}" : $startId); return $limitString; } @@ -1674,4 +1674,4 @@ public static function getInstance() { return self::$_instance; } -} \ No newline at end of file +} From 0b05c8484fee43b2a3ae93aeaf64eb289205b5f2 Mon Sep 17 00:00:00 2001 From: towser Date: Fri, 6 Dec 2013 16:06:52 +0800 Subject: [PATCH 2/4] =?UTF-8?q?PHP5.2=E5=85=BC=E5=AE=B9=E6=80=A7=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit array_map函数在PHP5.2.17下参数不支持传入类自身以调用类方法,具体存在兼容问题的版本不太清楚,实测PHP5.2.17是不可以的。修改为foreach后解决该问题。修改前,tools登录页会报错,同时验证码不能使用。 --- doitphp/core/Controller.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doitphp/core/Controller.class.php b/doitphp/core/Controller.class.php index 905e18c..791b781 100644 --- a/doitphp/core/Controller.class.php +++ b/doitphp/core/Controller.class.php @@ -699,7 +699,11 @@ protected static function _stripSlashes($data = array()) { return stripslashes($data); } - return array_map(array($this, '_stripSlashes'), $data); + foreach($data as &$_val){ + $_val = stripcslashes($_val); + } + + return $data; } /** @@ -798,4 +802,4 @@ public function __call($method, $args) { $this->halt('The method: ' . $method . '() is not found in ' . get_class($this) . ' class!', 'Normal'); } } -} \ No newline at end of file +} From 8fc8fa10fd47264ad23fdc5799d133141045c26d Mon Sep 17 00:00:00 2001 From: towser Date: Fri, 6 Dec 2013 16:10:10 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CONFIG_DIR未定义 --- doitphp/core/Configure.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doitphp/core/Configure.class.php b/doitphp/core/Configure.class.php index fb48792..4649eac 100644 --- a/doitphp/core/Configure.class.php +++ b/doitphp/core/Configure.class.php @@ -15,6 +15,8 @@ exit(); } +define('CONFIG_DIR', APP_ROOT . 'application/config/'); + abstract class Configure { /* @@ -265,4 +267,4 @@ private static function _getDefaultConfig() { return $defaultConfig; } -} \ No newline at end of file +} From 54d4eefb271b9b03c1dfd17bbcd8b457a84a7b5f Mon Sep 17 00:00:00 2001 From: towser Date: Tue, 10 Dec 2013 14:49:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?isMust=E6=96=B9=E6=B3=95=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=80=BC=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根据isMust语义,为空时应返回true,不为空返回false --- doitphp/library/Check.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doitphp/library/Check.class.php b/doitphp/library/Check.class.php index 99db7c3..a9281da 100644 --- a/doitphp/library/Check.class.php +++ b/doitphp/library/Check.class.php @@ -171,10 +171,10 @@ public static function isMust($string = null) { //参数分析 if (is_null($string)) { - return false; + return true; } - return is_null($string) ? false : true; + return is_null($string) ? true : false; } /** @@ -196,4 +196,4 @@ public static function isLength($string = null, $min = 0, $max = 255) { return (($length >= (int)$min) && ($length <= (int)$max)) ? true : false; } -} \ No newline at end of file +}