@fixme this is probably *horribly wrong*
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 3 Dec 2007 20:38:06 +0000 (20:38 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 3 Dec 2007 20:38:06 +0000 (20:38 +0000)
LanguageConverter seems to want $wgParser's uniqPrefix, however
if this is called for a parser cache hit, the parser may not
have ever been initialized in the first place.

Not really sure what the heck is supposed to be going on here...
For now, returning an empty string '' without dying out, but
leaving a stub exception comment in for testing.

includes/Parser.php

index e32ac7a..2899a11 100644 (file)
@@ -255,6 +255,15 @@ class Parser
         * @public
         */
        function uniqPrefix() {
+               if( !isset( $this->mUniqPrefix ) ) {
+                       // @fixme this is probably *horribly wrong*
+                       // LanguageConverter seems to want $wgParser's uniqPrefix, however
+                       // if this is called for a parser cache hit, the parser may not
+                       // have ever been initialized in the first place.
+                       // Not really sure what the heck is supposed to be going on here.
+                       return '';
+                       //throw new MWException( "Accessing uninitialized mUniqPrefix" );
+               }
                return $this->mUniqPrefix;
        }