Last modified: 2006-05-24 09:05:51 UTC
Using {{#ifeq: 03|3|eq|ne}}, it gives eq but not ne. This shows what ifeq compares are not strings but numbers. According to m:ParserFunctions#ifeq, ifeq should compares strings other than numbers. But in http://meta.wikimedia.org/wiki/User:Upssdr/tmp you see how it is. In ParserFunctions.php (http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ ParserFunctions/ParserFunctions.php?view=markup&pathrev=13773), the ifeq function is: if ( $left == $right ) { return $then; } else { return $else; }. The "==" may be the cause of problem.
As far as I'm concerned that's a feature and no bug, because forcing string comparison is simple, just add something that can't be numerical, e.g. use "p1" + "p2" instead of p1 + p2 for the first two parameters, or add character @ in front. Related question: Should we have default "then" and "else" result texts, more precisely 1 for equal and 0 for not equal?
Default then and else is empty. So the syntax can be like this: {{#ifeq: [str1 [| str2 [| then [| else]]]] }}
Okay, please decree this bug as "WONTFIX", because it was never broken... :-)