From: Arlo Breault Date: Thu, 1 Mar 2018 18:59:43 +0000 (-0500) Subject: Ensure abort link parsing on xmlish tag in link title position X-Git-Tag: 1.31.0-rc.0~463^2 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=ee1787dd512152314185d0cb4ebf15923f32a6b0;p=lhc%2Fweb%2Fwiklou.git Ensure abort link parsing on xmlish tag in link title position This shouldn't be dependent on the current definition of legal title chars and strip marker. See the test " inside a link" Change-Id: I0d87aca1bb0adf4ec5ac480e0373a65fcd150a72 --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 2adfd0a5d2..f6526ac564 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -2215,8 +2215,14 @@ class Parser { $link = $origLink; } - $unstrip = $this->mStripState->unstripNoWiki( $link ); - $nt = is_string( $unstrip ) ? Title::newFromText( $unstrip ) : null; + // \x7f isn't a default legal title char, so most likely strip + // markers will force us into the "invalid form" path above. But, + // just in case, let's assert that xmlish tags aren't valid in + // the title position. + $unstrip = $this->mStripState->killMarkers( $link ); + $noMarkers = ( $unstrip === $link ); + + $nt = $noMarkers ? Title::newFromText( $link ) : null; if ( $nt === null ) { $s .= $prefix . '[[' . $line; continue;