Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryLanguage.php |
— | — | @@ -53,6 +53,7 @@ |
54 | 54 | */ |
55 | 55 | public static function getComparatorFromString( $string, $defaultComparator = SMW_CMP_EQ ) { |
56 | 56 | self::initializeComparators(); |
| 57 | + if ( $string == '' ) return SMW_CMP_EQ; |
57 | 58 | return array_key_exists( $string, self::$comparators ) ? self::$comparators[$string] : $defaultComparator; |
58 | 59 | } |
59 | 60 | |
— | — | @@ -70,10 +71,13 @@ |
71 | 72 | static $reverseCache = false; |
72 | 73 | |
73 | 74 | if ( $reverseCache === false ) { |
74 | | - $reverseCache = array_reverse( self::$comparators ); |
| 75 | + $reverseCache = array_flip( self::$comparators ); |
75 | 76 | } |
76 | 77 | |
77 | | - if ( array_key_exists( $comparator, $reverseCache ) ) { |
| 78 | + if ( $comparator == SMW_CMP_EQ ) { |
| 79 | + return ''; |
| 80 | + } |
| 81 | + else if ( array_key_exists( $comparator, $reverseCache ) ) { |
78 | 82 | return $reverseCache[$comparator]; |
79 | 83 | } |
80 | 84 | else { |
— | — | @@ -107,7 +111,6 @@ |
108 | 112 | '≥' => SMW_CMP_GEQ, |
109 | 113 | '!' => SMW_CMP_NEQ, |
110 | 114 | '~' => SMW_CMP_LIKE, |
111 | | - '' => SMW_CMP_EQ, |
112 | 115 | ); |
113 | 116 | |
114 | 117 | $allowedComparators = explode( '|', $smwgQComparators ); |