From: Chad Horohoe Date: Fri, 10 Jul 2015 18:12:15 +0000 (-0700) Subject: Protect against non-text output from StripState going into Title::newFromText() X-Git-Tag: 1.31.0-rc.0~10816 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/message.php?a=commitdiff_plain;h=b8ced862bba14e25d3960638b9534c3c03b4c5ce;p=lhc%2Fweb%2Fwiklou.git Protect against non-text output from StripState going into Title::newFromText() Non-string input shouldn't be fed into newFromText(). We currently handle this indirectly with relying on Title to do it. Instead just return earlier and not try to construct a title from bad input. Bug: T102321 Change-Id: I9bc96111378d9d4ed5981bffc6f150cbd0c1e331 --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 7f925901fd..83c2b0c253 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -2147,7 +2147,8 @@ class Parser { $link = substr( $link, 1 ); } - $nt = Title::newFromText( $this->mStripState->unstripNoWiki( $link ) ); + $unstrip = $this->mStripState->unstripNoWiki( $link ); + $nt = is_string( $unstrip ) ? Title::newFromText( $unstrip ) : null; if ( $nt === null ) { $s .= $prefix . '[[' . $line; continue;