Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php |
— | — | @@ -754,15 +754,21 @@ |
755 | 755 | $where = $customSQL; |
756 | 756 | } |
757 | 757 | else { |
| 758 | + $value = $keys[$valueIndex]; |
| 759 | + |
758 | 760 | switch ( $description->getComparator() ) { |
759 | 761 | case SMW_CMP_EQ: $comparator = '='; break; |
760 | 762 | case SMW_CMP_LEQ: $comparator = '<='; break; |
761 | 763 | case SMW_CMP_GEQ: $comparator = '>='; break; |
762 | 764 | case SMW_CMP_NEQ: $comparator = '!='; break; |
| 765 | + case SMW_CMP_LIKE: case SMW_CMP_NLKE: |
| 766 | + $comparator = ' LIKE '; |
| 767 | + if ( $description->getComparator() == SMW_CMP_NLKE ) $comparator = " NOT{$comparator}"; |
| 768 | + $value = str_replace( array( '%', '_', '*', '?' ), array( '\%', '\_', '%', '_' ), $value ); |
763 | 769 | } |
764 | 770 | |
765 | 771 | if ( $comparator ) { |
766 | | - $where = "$query->alias.{$fieldName}{$comparator}" . $this->m_dbs->addQuotes( $keys[$valueIndex] ); |
| 772 | + $where = "$query->alias.{$fieldName}{$comparator}" . $this->m_dbs->addQuotes( $value ); |
767 | 773 | } |
768 | 774 | } |
769 | 775 | } |