Skip to content

Commit

Permalink
Really validate that $wgArticlePath starts with a slash
Browse files Browse the repository at this point in the history
The regular expression wasn't entirely correct.
Follow-up to a4a3d04.

Bug: T48998
Change-Id: I08bdf2db20c1c3de55527fc812bcbb55fa23f7bc
  • Loading branch information
MatmaRex authored and Chad Horohoe committed Dec 18, 2015
1 parent ce2b3c8 commit 3611c52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions includes/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,12 @@
$ps_validation = Profiler::instance()->scopedProfileIn( $fname . '-validation' );

// T48998: Bail out early if $wgArticlePath is non-absolute
if ( !preg_match( '/^https?:\/\/|\//', $wgArticlePath ) ) {
if ( !preg_match( '/^(https?:\/\/|\/)/', $wgArticlePath ) ) {
throw new FatalError(
'If you use a relative URL on $wgArticlePath, it must start ' .
'with a slash (/).<br><br>See ' .
'If you use a relative URL for $wgArticlePath, it must start ' .
'with a slash (<code>/</code>).<br><br>See ' .
'<a href="https://www.mediawiki.org/wiki/Manual:$wgArticlePath">' .
'https://www.mediawiki.org/wiki/Manual:$wgArticlePath</a>'
'https://www.mediawiki.org/wiki/Manual:$wgArticlePath</a>.'
);
}

Expand Down

0 comments on commit 3611c52

Please sign in to comment.