Bsitu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/158549

Change subject: Decode data coming from URL
......................................................................

Decode data coming from URL

Change-Id: I396c14578cc49c8cc10faf01ba83f46f2636cbf1
---
M includes/api/ApiFlow.php
M includes/api/ApiQueryFlow.php
M modules/new/flow-api.js
3 files changed, 3 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/49/158549/1

diff --git a/includes/api/ApiFlow.php b/includes/api/ApiFlow.php
index 100fe26..de7a180 100644
--- a/includes/api/ApiFlow.php
+++ b/includes/api/ApiFlow.php
@@ -106,9 +106,7 @@
         */
        protected function getPage( $params ) {
                if ( isset( $params['page'] ) ) {
-                       // urldecode is temporary hack to fix double-encoding 
from
-                       // the javascript frontend
-                       $page = Title::newFromText( urldecode( $params['page'] 
) );
+                       $page = Title::newFromText( $params['page'] );
                        if ( !$page ) {
                                $this->dieUsage( 'Invalid page provided', 
'invalid-page' );
                        }
diff --git a/includes/api/ApiQueryFlow.php b/includes/api/ApiQueryFlow.php
index 40192f4..bca52fc 100644
--- a/includes/api/ApiQueryFlow.php
+++ b/includes/api/ApiQueryFlow.php
@@ -22,9 +22,7 @@
                $params = $this->extractRequestParams();
                $passedParams = FormatJson::decode( $params['params'], true );
 
-               // urldecode is temporary hack to fix double-encoding from
-               // the javascript frontend
-               $pageTitle = Title::newFromText( urldecode( $params['page'] ) );
+               $pageTitle = Title::newFromText( $params['page'] );
                $id = $params['workflow'] ? UUID::create( $params['workflow'] ) 
: null;
 
                $this->loader = $this->container['factory.loader.workflow']
diff --git a/modules/new/flow-api.js b/modules/new/flow-api.js
index 7693c16..46e51e4 100644
--- a/modules/new/flow-api.js
+++ b/modules/new/flow-api.js
@@ -243,7 +243,7 @@
 
                                // Only add this to the query map if it didn't 
already exist, eg. in a form input
                                if ( !queryMap[ split[ 0 ] ] ) {
-                                       queryMap[ split[ 0 ] ] = split.slice( 1 
).join( '=' ); // if extra = are present
+                                       queryMap[ split[ 0 ] ] = 
decodeURIComponent( split.slice( 1 ).join( '=' ) ); // if extra = are present
                                }
                        }
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I396c14578cc49c8cc10faf01ba83f46f2636cbf1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>

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

Reply via email to