r40762 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40761‎ | r40762 | r40763 >
Date:22:06, 12 September 2008
Author:simetrical
Status:old
Tags:
Comment:
(bug 15349) Accept more types of minuses in #expr

{{#expr:1 − 2}} and {{#expr:1 − 2}} now work, in the same vein as {{#ifexpr:3 < 4|...}} does. This allows human-formatted template values to work more reliably when fed to #expr. Patch by Doug Strain.
Modified paths:
  • /trunk/extensions/ParserFunctions/Expr.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFunctions/Expr.php
@@ -164,7 +164,8 @@
165165 $operators = array();
166166
167167 # Unescape inequality operators
168 - $expr = strtr( $expr, array( '&lt;' => '<', '&gt;' => '>' ) );
 168+ $expr = strtr( $expr, array( '&lt;' => '<', '&gt;' => '>',
 169+ '&minus;' => '-', '−' => '-' ) );
169170
170171 $p = 0;
171172 $end = strlen( $expr );

Follow-up revisions

RevisionCommit summaryAuthorDate
r47428Revert Expr.php to r40762 for now -- still some errors that need tracking dow...werdna05:57, 18 February 2009