X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParser.php;h=9ec58346cc9ebe9b3d728d0f99a9e4263806aecf;hb=5155abe0e6ab6589d4104a221df0a0b2c5142c16;hp=b27338ca2bfc8da6ea7ef273477a04d0035a3561;hpb=54c93f1d384cd5accd2db2ebbb911e4d627c2980;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index b27338ca2b..9ec58346cc 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -910,7 +910,7 @@ class Parser { */ public function setTitle( $t ) { if ( !$t ) { - $t = Title::newFromText( 'NO TITLE' ); + $t = Title::makeTitle( NS_SPECIAL, 'Badtitle/Parser' ); } if ( $t->hasFragment() ) { @@ -2312,6 +2312,11 @@ class Parser { $line = $a->current(); # Workaround for broken ArrayIterator::next() that returns "void" $s = substr( $s, 1 ); + if ( is_null( $this->mTitle ) ) { + throw new MWException( __METHOD__ . ": \$this->mTitle is null\n" ); + } + $nottalk = !$this->mTitle->isTalkPage(); + $useLinkPrefixExtension = $this->getTargetLanguage()->linkPrefixExtension(); $e2 = null; if ( $useLinkPrefixExtension ) { @@ -2319,14 +2324,6 @@ class Parser { # e.g. in the case of 'The Arab al[[Razi]]', 'al' will be matched $charset = $this->contLang->linkPrefixCharset(); $e2 = "/^((?>.*[^$charset]|))(.+)$/sDu"; - } - - if ( is_null( $this->mTitle ) ) { - throw new MWException( __METHOD__ . ": \$this->mTitle is null\n" ); - } - $nottalk = !$this->mTitle->isTalkPage(); - - if ( $useLinkPrefixExtension ) { $m = []; if ( preg_match( $e2, $s, $m ) ) { $first_prefix = $m[2];