Last modified: 2013-04-10 11:55:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49010, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47010 - encodeParameters
encodeParameters
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
REL1_20-branch
All All
: Unprioritized normal (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-08 11:08 UTC by Dima
Modified: 2013-04-10 11:55 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Dima 2013-04-08 11:08:23 UTC
Error in

\extensions\SemanticMediaWiki\includes\SMW_Infolink.php [352]

encodeParameters()

---------------------------

Description:

{{#ask:[[Article::+]] [[Full name::+]]
|?#
|?Full name=fullname
|?Photo=photo
|?Source=cource
|?Anchor=anchor
|?Author=author
|?Description=text
|limit=1
|format=template
|link=none
|headers=hide
|mainlabel=page
|searchlabel=… next results
|named args=1
|template=Article
}}

Result:

...text...
...text...
...text...

[http://wiki.mirsimpatov.net/index.php?title=%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F:Ask&x=-5B-5B%D0%A0%D0%B0%D0%B7%D0%BC%D0%B5%D1%80-20%D1%81%D1%82%D0%B0%D1%82%D1%8C%D0%B8%3A%3A-3C5000-5D-5D-20-20-5B-5B%D0%A6%D0%B8%D1%82%D0%B0%D1%82%D0%B0-2F%D0%A1%D0%B2%D0%BE%D0%B9%D1%81%D1%82%D0%B2%D0%B0%3A%3A%2B-5D-5D-20-5B-5B%D0%98%D0%BD%D1%82%D0%B5%D1%80%D0%B5%D1%81%D0%BD%D0%BE%D0%B5-20%D0%BF%D0%BE-20%D1%82%D0%B5%D0%B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%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B5%20%D1%80%D0%B5%D0%B7%D1%83%D0%BB%D1%8C%D1%82%D0%B0%D1%82%D1%8B&template=%D0%A6%D0%B8%D1%82%D0%B0%D1%82%D0%B0%2F%D0%A1%D1%82%D0%B0%D1%82%D1%8C%D1%8F&named args=1&offset=1 … next results]

---------------------------

Link to the next results appear as follows: 

<a href="...">args=1&offset=1 … next results</a>

---------------------------

Spaces in the link must be encoded:

named args => named%20args
Comment 1 Dima 2013-04-08 11:13:05 UTC
Resolving:

395: $value = $name . '=' . rawurlencode( $value );

=>

395: $value = rawurlencode($name) . '=' . rawurlencode( $value );
Comment 2 Gerrit Notification Bot 2013-04-08 12:18:53 UTC
Related URL: https://gerrit.wikimedia.org/r/58077 (Gerrit Change I5f0a51a9f4428cd3976ab7d0f55af66ea3fb0df7)
Comment 3 Jeroen De Dauw 2013-04-08 12:19:30 UTC
https://gerrit.wikimedia.org/r/#/c/58077/

Thanks for the patch - just submitted it to gerrit
Comment 4 Gerrit Notification Bot 2013-04-08 13:24:42 UTC
Related URL: https://gerrit.wikimedia.org/r/58080 (Gerrit Change Ic15c0f9c3ce40bddeda65cab0200584054a0506e)
Comment 5 Dima 2013-04-08 13:36:24 UTC
Another error in decodeParameters()

$wgRequest->getValues();


["named_args"]=1

must be

["named args"]=1


Resolving:

446: $result = $wgRequest->getValues();

=>

446: foreach ($wgRequest->getValues() as $key => $value) {
447: 	   $result[str_replace( '_', ' ', $key)] = $value;
448: }
Comment 6 Gerrit Notification Bot 2013-04-08 19:17:09 UTC
https://gerrit.wikimedia.org/r/58080 (Gerrit Change Ic15c0f9c3ce40bddeda65cab0200584054a0506e) | change APPROVED and MERGED [by jenkins-bot]
Comment 7 MWJames 2013-04-08 19:21:13 UTC
I merged a regression test for the first issue. Please enhance the test if necessary for other parameter encoding/decoding issues.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links