Last modified: 2013-11-03 09:05:33 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 T48095, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46095 - {{#switch}} should not cast values to integers or floats
{{#switch}} should not cast values to integers or floats
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
master
All All
: High major (vote)
: MW 1.21 version
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-14 02:48 UTC by Krinkle
Modified: 2013-11-03 09:05 UTC (History)
2 users (show)

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


Attachments

Description Krinkle 2013-03-14 02:48:39 UTC
{{#switch: 1.20
|1.1=a
|1.2=b
|1.10=h
|1.20=t
}} --> b

{{#switch: 1.10
|1.1=a
|1.2=b
|1.10=h
|1.20=t
}} --> a

I don't know when this happened, but it happened recently I think.
Comment 1 Kevin Israel (PleaseStand) 2013-11-02 12:42:06 UTC
Not a regression; this was probably always broken because of the use of == instead of === in the relevant parts of the code.

In fact, this is documented at <https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#Comparison_behaviour>. Fixing this may break compatibility with existing wikitext.
Comment 2 Kevin Israel (PleaseStand) 2013-11-03 09:05:33 UTC
Of course, that's not to say I like the current behavior: it can make the result depend on PHP_INT_MAX!

{{#ifeq:4000000000000000000|4000000000000000001|32-bit|64-bit}}

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


Navigation
Links