https://bugzilla.wikimedia.org/show_bug.cgi?id=43600
Web browser: ---
Bug ID: 43600
Summary: query string's ending semicolon can appear to be the
last field's value
Product: MediaWiki extensions
Version: master
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: Unprioritized
Component: EventLogging
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
Classification: Unclassified
Mobile Platform: ---
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l