r75229 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75228‎ | r75229 | r75230 >
Date:12:03, 23 October 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Removed non-working comparators
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/SMW_Settings.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php
@@ -396,6 +396,11 @@
397397 *
398398 * @param string $value
399399 * @param string $comparator
 400+ *
 401+ * TODO: It would be better to have an associative array that maps comparator strings
 402+ * to their internal meaning, so this switch and the reverse one in SMWValueDescription
 403+ * can be thrown away. This would allow to extend the comparators more easily, without
 404+ * breaking things.
400405 */
401406 static protected function prepareValue( &$value, &$comparator ) {
402407 global $smwgQComparators, $smwStrictComparators;
@@ -422,10 +427,10 @@
423428 case '!~':
424429 $comparator = SMW_CMP_NLKE;
425430 break;
426 - case '>=': case '≥' :
 431+ case '≥' :
427432 $comparator = SMW_CMP_GEQ;
428433 break;
429 - case '<=': case '≤' :
 434+ case '≤' :
430435 $comparator = SMW_CMP_LEQ;
431436 break;
432437 // default: not possible
Index: trunk/extensions/SemanticMediaWiki/SMW_Settings.php
@@ -203,14 +203,14 @@
204204 * ! (unequal to)
205205 * ~ (pattern with '*' as wildcard, only for Type:String)
206206 * !~ (not a pattern with '*' as wildcard, only for Type:String, need to be placed before ! and ~ to work correctly)
207 - * <= or ≤(smaller than or equal to)
208 - * >= or ≥(greater than or equal to)
 207+ * ≤ (smaller than or equal to)
 208+ * ≥ (greater than or equal to)
209209 *
210210 * If unsupported comparators are used, they are treated as part of the queried value
211211 *
212212 * @var string
213213 */
214 -$smwgQComparators = '<|>|!~|!|~|<=|>=|≤|≥';
 214+$smwgQComparators = '<|>|!~|!|~|≤|≥';
215215
216216 ###
217217 # Sets whether the > and < comparators should be strict or not. If they are strict,

Status & tagging log