Make Title::newFromIDs() work properly when given an empty array.
authorTim Starling <tstarling@users.mediawiki.org>
Thu, 17 Jan 2008 12:33:35 +0000 (12:33 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Thu, 17 Jan 2008 12:33:35 +0000 (12:33 +0000)
includes/Title.php

index 7ae2a67..7ff1db9 100644 (file)
@@ -207,6 +207,9 @@ class Title {
         * Make an array of titles from an array of IDs 
         */
        public static function newFromIDs( $ids ) {
+               if ( !count( $ids ) ) {
+                       return array();
+               }
                $dbr = wfGetDB( DB_SLAVE );
                $res = $dbr->select( 'page', array( 'page_namespace', 'page_title' ),
                        'page_id IN (' . $dbr->makeList( $ids ) . ')', __METHOD__ );