From 3611c520e3e6f5069ce15d215e5f492148c11966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 11 Nov 2015 23:00:31 +0100 Subject: [PATCH] Really validate that $wgArticlePath starts with a slash The regular expression wasn't entirely correct. Follow-up to a4a3d0454069c25a24e2bfe732a665cc6a865878. Bug: T48998 Change-Id: I08bdf2db20c1c3de55527fc812bcbb55fa23f7bc --- includes/Setup.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/Setup.php b/includes/Setup.php index 04a8459965deb..905a1d10a6d1b 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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 (/).

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.' ); }