From 3fd3da3d46e4c863b63e69dffa442ee5edb62f30 Mon Sep 17 00:00:00 2001 From: Bill Schaller Date: Wed, 17 Dec 2014 16:00:54 -0500 Subject: [PATCH] Fixed removal of ASC and DESC keywords from orderby items that will be included in select list --- lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php index 654177324..b1d68e350 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php +++ b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php @@ -289,7 +289,7 @@ class LimitSubqueryOutputWalker extends SqlWalker // The order by items are not required to be in the select list on Oracle and PostgreSQL, but // for the sake of simplicity, order by items will be included in the select list on all platforms. // This doesn't impact functionality. - $selectListAdditions[] = trim(str_ireplace(array("asc", "desc"), "", $orderByItem)); + $selectListAdditions[] = trim(preg_replace('/([^ ]+) (?:asc|desc)/i', '$1', $orderByItem)); $orderByItems[] = $orderByItem; }