Page MenuHomePhabricator

{{nse:Something that is not a namespace}} causes php warning
Closed, ResolvedPublic


{{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 />

Version: 1.19
Severity: normal