Index: trunk/phase3/includes/cache/MessageCache.php |
— | — | @@ -817,15 +817,23 @@ |
818 | 818 | $popts->setTargetLanguage( $language ); |
819 | 819 | } |
820 | 820 | |
| 821 | + wfProfileIn( __METHOD__ ); |
821 | 822 | if ( !$title || !$title instanceof Title ) { |
822 | 823 | global $wgTitle; |
823 | 824 | $title = $wgTitle; |
824 | 825 | } |
| 826 | + // Sometimes $wgTitle isn't set either... |
| 827 | + if ( !$title ) { |
| 828 | + # It's not uncommon having a null $wgTitle in scripts. See r80898 |
| 829 | + # Create a ghost title in such case |
| 830 | + $title = Title::newFromText( 'Dwimmerlaik' ); |
| 831 | + } |
825 | 832 | |
826 | 833 | $this->mInParser = true; |
827 | 834 | $res = $parser->parse( $text, $title, $popts, $linestart ); |
828 | 835 | $this->mInParser = false; |
829 | 836 | |
| 837 | + wfProfileOut( __METHOD__ ); |
830 | 838 | return $res; |
831 | 839 | } |
832 | 840 | |