]> git.mjollnir.org Git - moodle.git/commitdiff
fixed sql error when searching only by one letter and two radio buttons selected...
authorskodak <skodak>
Sun, 22 Oct 2006 19:42:27 +0000 (19:42 +0000)
committerskodak <skodak>
Sun, 22 Oct 2006 19:42:27 +0000 (19:42 +0000)
message/lib.php
message/search.html

index 2e9f3d88f2c49bb975e7246f2390d8e30ec1b75e..52edb75e4c0d1eaceef9050a19f0cb56411a70b5 100644 (file)
@@ -754,6 +754,9 @@ function message_search($searchterms, $fromme=true, $tome=true, $courseid='none'
         }
     }
 
+    if ($messagesearch == '') { // if only 1 letter words searched
+        return false;
+    }
 
     $messagesearch = "($messagesearch) ";
 
index 472fe2d3b4ec9e0496554a27ad0768883d7c506c..a6b3d798fc5a12edaf6078bd39902393d62d08eb 100644 (file)
@@ -39,7 +39,7 @@
             <input type="checkbox" name="includeblocked" alt="<?php print_string('includeblockedusers', 'message') ?>" /><?php print_string('includeblockedusers', 'message') ?></td>
     </tr>
     
-    <tr><td>&nbsp;</td><td colspan="2"><input type="radio" name="keywordsoption" alt="<?php print_string('onlytome', 'message') ?>" value="tome" checked="checked" /><?php print_string('onlytome', 'message') ?></td></tr>
+    <tr><td>&nbsp;</td><td colspan="2"><input type="radio" name="keywordsoption" alt="<?php print_string('onlytome', 'message') ?>" value="tome" /><?php print_string('onlytome', 'message') ?></td></tr>
     <tr><td>&nbsp;</td><td colspan="2"><input type="radio" name="keywordsoption" alt="<?php print_string('onlyfromme', 'message') ?>" value="fromme" /><?php print_string('onlyfromme', 'message') ?></td></tr>
     <tr><td>&nbsp;</td><td colspan="2"><input type="radio" checked="checked" name="keywordsoption" alt="<?php print_string('allmine', 'message') ?>" value="allmine" /><?php print_string('allmine', 'message') ?></td></tr>