Page MenuHomePhabricator

query string's ending semicolon can appear to be the last field's value
Closed, ResolvedPublic

Description

If the last key's value in the query string is empty, then the trailing semicolon appears to be its value. For example,

mw.eventLog.schemas.GettingStarted.defaults = {};
mw.eventLog.logEvent( 'GettingStarted', {anon: false, action: "x", token: ""} );

validates OK but logs as /event.gif?_db=my_wiki&_id=GettingStarted&_rv=4910146&_ok=true&anon=false&action=x&token=;

and DevServer.php interprets this final parameter as { token: ";" }. The server log2json.py code strips the semicolon (using parse_qsl(q.strip('?;')) ) so that endpoint doesn't experience this bug.

One fix might be to always pad the query string with &;, in logEvent()

beacon.src = baseUri + '?' + queryString + '&;';

This bug will go away when and if we encode a JSON structure in the query string, as its key values are delimited by JSON punctuation.


Version: unspecified
Severity: minor

Details

Reference
bz43600

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:18 AM
bzimport set Reference to bz43600.

[moving from MediaWiki extensions to Analytics product - see bug 61946]