From: Bartosz DziewoƄski Date: Wed, 11 Nov 2015 22:00:31 +0000 (+0100) Subject: Really validate that $wgArticlePath starts with a slash X-Git-Tag: 1.31.0-rc.0~9007^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=6fb44cf116172261ef6724da8356287c9ea813f0;p=lhc%2Fweb%2Fwiklou.git Really validate that $wgArticlePath starts with a slash The regular expression wasn't entirely correct. Follow-up to a4a3d0454069c25a24e2bfe732a665cc6a865878. Bug: T48998 Change-Id: I08bdf2db20c1c3de55527fc812bcbb55fa23f7bc --- diff --git a/includes/Setup.php b/includes/Setup.php index d826b8762f..bd20ac3579 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -520,12 +520,12 @@ require_once "$IP/includes/compat/normal/UtfNormalUtil.php"; $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 (/).

See ' . + 'If you use a relative URL for $wgArticlePath, it must start ' . + 'with a slash (/).

See ' . '' . - 'https://www.mediawiki.org/wiki/Manual:$wgArticlePath' + 'https://www.mediawiki.org/wiki/Manual:$wgArticlePath.' ); }