]> git.mjollnir.org Git - moodle.git/commitdiff
case insensitive tag search
authortoyomoyo <toyomoyo>
Thu, 16 Mar 2006 07:41:26 +0000 (07:41 +0000)
committertoyomoyo <toyomoyo>
Thu, 16 Mar 2006 07:41:26 +0000 (07:41 +0000)
blog/class.BlogFilter.php

index 2dfff0b4cefa056041bcff2a67852af8c35228d6..710f0487527f238f63153ccbdd0023a65620cba8 100755 (executable)
@@ -84,8 +84,11 @@ class BlogFilter {
         if ($tagid) {
             $this->tag = $tagid;
         } else if ($tag) {
-            $tagrec = get_record('tags', 'text', $tag);
-            $this->tag = $tagrec -> id;
+            if ($tagrec = get_record_sql('SELECT * FROM '.$CFG->prefix.'tags WHERE text LIKE "'.$tag.'"')) {
+                $this->tag = $tagrec -> id;
+            } else {
+                $this->tag = -1;    //no record found
+            }
         }
         // borrowed from Jon's table class
         if(empty($this->baseurl)) {