- Patch #180646 by John Morahan: SQL in taxonomy_get_term_by_name() should use = instead of LIKE.

merge-requests/26/head
Dries Buytaert 2008-06-28 19:51:02 +00:00
parent 6fca076ead
commit 3c81924d7e
1 changed files with 1 additions and 1 deletions

View File

@ -953,7 +953,7 @@ function _taxonomy_term_children($tid) {
* An array of matching term objects.
*/
function taxonomy_get_term_by_name($name) {
$db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER(t.name) LIKE LOWER('%s')", 't', 'tid'), trim($name));
$db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER(t.name) = LOWER('%s')", 't', 'tid'), trim($name));
$result = array();
while ($term = db_fetch_object($db_result)) {
$result[] = $term;