https://bugzilla.wikimedia.org/show_bug.cgi?id=37378
Web browser: ---
Bug #: 37378
Summary: mw.util.getParamValue( 'diff' ) !== null
Product: MediaWiki
Version: 1.20-git
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: JavaScript
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Mobile Platform: ---
The following links generates all a difference between revisions:
https://www.mediawiki.org/wiki/?diff
https://www.mediawiki.org/wiki/?diff=
https://www.mediawiki.org/wiki/?diff=0
https://www.mediawiki.org/wiki/?dif%66=0
The JavaScript function mw.util.getParamValue( 'diff' ) generates:
mw.util.getParamValue( 'diff', '?diff' ) // null
mw.util.getParamValue( 'diff', '?diff=' ) // ""
mw.util.getParamValue( 'diff', '?diff=0' ) // 0
mw.util.getParamValue( 'diff', '?dif%66=0' ) // null
The suggested usage in
https://www.mediawiki.org/wiki/ResourceLoader/Default_modules#getParamValue
mw.util.getParamValue( 'diff' ) !== null
isn't suitable to distinguish between difference and normal view.
It should be possible in JavaScript to get the same result as in PHP.
A possible solution would be to transfer a normalized URL as string or object
in a wiki global with the content.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l