http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67483
Revision: 67483 Author: jeroendedauw Date: 2010-06-06 22:49:45 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Fixed like comparator regression Modified Paths: -------------- trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php Modified: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php =================================================================== --- trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php 2010-06-06 22:31:01 UTC (rev 67482) +++ trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php 2010-06-06 22:49:45 UTC (rev 67483) @@ -754,15 +754,21 @@ $where = $customSQL; } else { + $value = $keys[$valueIndex]; + switch ( $description->getComparator() ) { case SMW_CMP_EQ: $comparator = '='; break; case SMW_CMP_LEQ: $comparator = '<='; break; case SMW_CMP_GEQ: $comparator = '>='; break; case SMW_CMP_NEQ: $comparator = '!='; break; + case SMW_CMP_LIKE: case SMW_CMP_NLKE: + $comparator = ' LIKE '; + if ( $description->getComparator() == SMW_CMP_NLKE ) $comparator = " NOT{$comparator}"; + $value = str_replace( array( '%', '_', '*', '?' ), array( '\%', '\_', '%', '_' ), $value ); } if ( $comparator ) { - $where = "$query->alias.{$fieldName}{$comparator}" . $this->m_dbs->addQuotes( $keys[$valueIndex] ); + $where = "$query->alias.{$fieldName}{$comparator}" . $this->m_dbs->addQuotes( $value ); } } } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs