Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/262064
Change subject: Validate that $wgVariantArticlePath is absolute, too
......................................................................
Validate that $wgVariantArticlePath is absolute, too
Follow-up to a4a3d0454069c25a24e2bfe732a665cc6a865878.
Unlikely to be a security problem, as $2 generally has to
appear somewhere before $1 in this config option.
Bug: T48998
Change-Id: I08788713d9bd7c4c8d81479c18b5a404997a778d
---
M includes/Setup.php
1 file changed, 9 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/64/262064/1
diff --git a/includes/Setup.php b/includes/Setup.php
index c863722..d87f32a 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -512,13 +512,15 @@
$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 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>.'
- );
+foreach ( array( 'wgArticlePath', 'wgVariantArticlePath' ) as $varName ) {
+ if ( !preg_match( '/^(https?:\/\/|\/)/', $$varName ) ) {
+ throw new FatalError(
+ "If you use a relative URL for \$$varName, it must
start " .
+ 'with a slash (<code>/</code>).<br><br>See ' .
+ "<a
href=\"https://www.mediawiki.org/wiki/Manual:\$$varName\">" .
+ "https://www.mediawiki.org/wiki/Manual:\$$varName</a>."
+ );
+ }
}
Profiler::instance()->scopedProfileOut( $ps_validation );
--
To view, visit https://gerrit.wikimedia.org/r/262064
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I08788713d9bd7c4c8d81479c18b5a404997a778d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits