Lazy initialisation of wgProxyList, no flip required
[lhc/web/wiklou.git] / includes / LinkCache.php
index 57903dd..dd87fce 100644 (file)
@@ -135,6 +135,11 @@ class LinkCache {
                if ( 0 != $id ) { return $id; }
 
                $fname = 'LinkCache::addLinkObj';
+               global $wgProfiler;
+               if ( isset( $wgProfiler ) ) {
+                       $fname .= ' (' . $wgProfiler->getCurrentSection() . ')';
+               }
+
                wfProfileIn( $fname );
 
                $ns = $nt->getNamespace();
@@ -363,7 +368,11 @@ class LinkBatch {
        }
 
        function addObj( $title ) {
-               $this->add( $title->getNamespace(), $title->getDBkey() );
+               if ( is_object( $title ) ) {
+                       $this->add( $title->getNamespace(), $title->getDBkey() );
+               } else {
+                       wfDebug( "Warning: LinkBatch::addObj got invalid title object\n" );
+               }
        }
 
        function add( $ns, $dbkey ) {