Last modified: 2012-03-26 18:54:53 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 T37446, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35446 - {{nse:Something that is not a namespace}} causes php warning
{{nse:Something that is not a namespace}} causes php warning
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.19
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-24 03:27 UTC by Bawolff (Brian Wolff)
Modified: 2012-03-26 18:54 UTC (History)
2 users (show)

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


Attachments

Description Bawolff (Brian Wolff) 2012-03-24 03:27:16 UTC
{{nse:Something that is not a namespace}} triggers a php warning, since {{nse:Something not a namespace}} calls CoreParserFunctions::ns( $parser, "something not a namespace" ) (the same function that handles {{ns:...}}, which in case of not getting a valid namespace will return an array to specify failure to the parser. However nse assumes it always succedes (and thus always returns a string), so it passes the return value directly to urlencode.

nse needs to be changed to check that CoreParserFunctions::ns returns a string before trying to urlencode it. If it gets something back that is not a string it should return the result immediately without processing it further.

Relevant warning generated:

<b>Warning</b>:  urlencode() expects parameter 1 to be string, array given in <b>/var/www/w/phase3/includes/GlobalFunctions.php</b> on line <b>351</b><br />
Comment 1 Alexandre Emsenhuber [IAlex] 2012-03-26 18:54:53 UTC
Fixed in:
https://gerrit.wikimedia.org/r/#change,3748 (master)
https://gerrit.wikimedia.org/r/#change,3750 (REL1_19)
https://gerrit.wikimedia.org/r/#change,3751 (REL1_18)

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


Navigation
Links