From 46136fbf706a48e9dbe87ec2ad702ed2a9f4ee44 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 19 Feb 2016 09:46:53 +0800 Subject: [PATCH] * adjust for task #2478. --- lib/dao/dao.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dao/dao.class.php b/lib/dao/dao.class.php index 6fd33efab6..d64a971392 100755 --- a/lib/dao/dao.class.php +++ b/lib/dao/dao.class.php @@ -551,8 +551,8 @@ class dao /* Remove the part after order and limit. */ $subLength = strlen($sql); - $orderPOS = strrpos($sql, 'order '); - $limitPOS = strrpos($sql , 'limit'); + $orderPOS = strripos($sql, 'order by'); + $limitPOS = strripos($sql, 'limit'); if($limitPOS) $subLength = $limitPOS; if($orderPOS) $subLength = $orderPOS; $sql = substr($sql, 0, $subLength);