From: JuneHyeon Bae Date: Sat, 24 May 2014 10:48:02 +0000 (+0900) Subject: Validates wgArticlePath does start with slash (/). X-Git-Tag: 1.31.0-rc.0~9024^2 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=a4a3d0454069c25a24e2bfe732a665cc6a865878;p=lhc%2Fweb%2Fwiklou.git Validates wgArticlePath does start with slash (/). When relative URL used in $wgArticlePath, and $wgArticlePath does not start with slash (/), raise FatalError. Bug: T48998 Change-Id: Ic7cd6f774cff97081f4f35af351161170b4b26eb --- diff --git a/includes/Setup.php b/includes/Setup.php index ce091f176b..d826b8762f 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -516,6 +516,21 @@ MWExceptionHandler::installHandler(); 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 ) ) { + throw new FatalError( + 'If you use a relative URL on $wgArticlePath, it must start ' . + 'with a slash (/).

See ' . + '' . + 'https://www.mediawiki.org/wiki/Manual:$wgArticlePath' + ); +} + +Profiler::instance()->scopedProfileOut( $ps_validation ); + $ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' ); if ( $wgCanonicalServer === false ) {