Mobrovac has submitted this change and it was merged.

Change subject: Replace wfUrlEncode with rawurlencode
......................................................................


Replace wfUrlEncode with rawurlencode

wfUrlEncode doesn't encode slashes, but change-prop
expects slashes to be encoded, so replace it with
standard php rawurlencode function.

Change-Id: Ic1db69fc051adfe73453f26fca3927d8b00bee82
---
M EventBus.hooks.php
M extension.json
2 files changed, 6 insertions(+), 3 deletions(-)

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



diff --git a/EventBus.hooks.php b/EventBus.hooks.php
index ddbe02a..81f1f31 100644
--- a/EventBus.hooks.php
+++ b/EventBus.hooks.php
@@ -68,7 +68,10 @@
         */
        private static function getArticleURL( $title ) {
                global $wgCanonicalServer, $wgArticlePath;
-               $titleURL = $title->getPrefixedURL();
+               // can't use wfUrlencode, because it doesn't encode slashes. 
RESTBase
+               // and services expect slashes to be encoded, so encode the 
whole title
+               // right away to avoid reencoding it in change-propagation
+               $titleURL = rawurlencode( $title->getPrefixedDBkey() );
                // The $wgArticlePath contains '$1' string where the article 
title should appear.
                return $wgCanonicalServer . str_replace( '$1', $titleURL, 
$wgArticlePath );
        }
@@ -82,7 +85,7 @@
        private static function getUserPageURL( $userName ) {
                global $wgCanonicalServer, $wgArticlePath, $wgContLang;
                $prefixedUserURL = $wgContLang->getNsText( NS_USER ) . ':' . 
$userName;
-               $encodedUserURL = wfUrlencode( strtr( $prefixedUserURL, ' ', 
'_' ) );
+               $encodedUserURL = rawurlencode( strtr( $prefixedUserURL, ' ', 
'_' ) );
                // The $wgArticlePath contains '$1' string where the article 
title should appear.
                return $wgCanonicalServer . str_replace( '$1', $encodedUserURL, 
$wgArticlePath );
        }
diff --git a/extension.json b/extension.json
index d90b5dd..eed6258 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
        "name": "EventBus",
-       "version": "0.2.7",
+       "version": "0.2.8",
        "author": [
                "Eric Evans"
        ],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic1db69fc051adfe73453f26fca3927d8b00bee82
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventBus
Gerrit-Branch: master
Gerrit-Owner: Ppchelko <ppche...@wikimedia.org>
Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: Ppchelko <ppche...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to