* Remove manual query building in search mysql
[lhc/web/wiklou.git] / includes / SquidUpdate.php
index d0fe51b..91f1d28 100644 (file)
@@ -40,8 +40,7 @@ class SquidUpdate {
                        __METHOD__ );
                $blurlArr = $title->getSquidURLs();
                if ( $dbr->numRows( $res ) <= $wgMaxSquidPurgeTitles ) {
-                       while ( $BL = $dbr->fetchObject ( $res ) )
-                       {
+                       foreach ( $res as $BL ) {
                                $tobj = Title::makeTitle( $BL->page_namespace, $BL->page_title ) ;
                                $blurlArr[] = $tobj->getInternalURL();
                        }
@@ -194,9 +193,10 @@ class SquidUpdate {
         * @return string
         */
        static function expand( $url ) {
-               global $wgInternalServer;
-               if( $url != '' && $url{0} == '/' ) {
-                       return $wgInternalServer . $url;
+               global $wgInternalServer, $wgServer;
+               $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer;
+               if( $url !== '' && $url[0] == '/' ) {
+                       return $server . $url;
                }
                return $url;
        }