jenkins-bot has submitted this change and it was merged.

Change subject: Don't register a root template ('/$1') with PathRouter
......................................................................


Don't register a root template ('/$1') with PathRouter

If it is in the root, MediaWiki won't be able to handle it.

Bug: T108558
Change-Id: Id09b6b48f1ff806a69a1dff2776e3ad581e714b1
---
M UrlShortener.hooks.php
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/UrlShortener.hooks.php b/UrlShortener.hooks.php
index 6e881e1..7227fde 100644
--- a/UrlShortener.hooks.php
+++ b/UrlShortener.hooks.php
@@ -17,7 +17,8 @@
         */
        public static function onWebRequestPathInfoRouter( $router ) {
                global $wgUrlShortenerTemplate;
-               if ( $wgUrlShortenerTemplate ) {
+               // If a template is set, and it is not the root, register it
+               if ( $wgUrlShortenerTemplate && $wgUrlShortenerTemplate !== 
'/$1' ) {
                        $router->add( $wgUrlShortenerTemplate,
                                array( 'title' => SpecialPage::getTitleFor( 
'UrlRedirector', '$1' )->getPrefixedText() )
                        );

-- 
To view, visit https://gerrit.wikimedia.org/r/228455
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id09b6b48f1ff806a69a1dff2776e3ad581e714b1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/UrlShortener
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to