From 6fb44cf116172261ef6724da8356287c9ea813f0 Mon Sep 17 00:00:00 2001 From: =?utf8?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 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.' ); } -- 2.20.1