Missing space for 'ORDER BY' in PDO.php

Christof Meerwald via Phpwiki-talk <[email protected]> Sun, 20 Apr 2025 15:58:47 +0200
Newsgroups gmane.comp.web.wiki.phpwiki.talk
Message-ID <[email protected]>
--GXwyuTuTA+CjiHDj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

ORDER BY clause needs a space to get valid SQL, patch attached.


Christof

-- 
https://cmeerw.org                             sip:cmeerw at cmeerw.org
mailto:cmeerw at cmeerw.org                   xmpp:cmeerw at cmeerw.org

--GXwyuTuTA+CjiHDj
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="PDO.php.diff"

Index: lib/WikiDB/backend/PDO.php
===================================================================
--- lib/WikiDB/backend/PDO.php	(revision 11193)
+++ lib/WikiDB/backend/PDO.php	(working copy)
@@ -1119,7 +1119,7 @@
         $dbh = &$this->_dbh;
         extract($this->_table_names);
         if ($orderby = $this->sortby($sortby, 'db', array('pagename', 'wantedfrom'))) {
-            $orderby = 'ORDER BY ' . $orderby;
+            $orderby = ' ORDER BY ' . $orderby;
         }
 
         if ($exclude) { // array of pagenames

--GXwyuTuTA+CjiHDj
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--GXwyuTuTA+CjiHDj
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Phpwiki-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpwiki-talk

--GXwyuTuTA+CjiHDj--