]> git.mjollnir.org Git - moodle.git/commitdiff
Now wiki supports Unicode searches
authorstronk7 <stronk7>
Tue, 31 Oct 2006 17:51:12 +0000 (17:51 +0000)
committerstronk7 <stronk7>
Tue, 31 Oct 2006 17:51:12 +0000 (17:51 +0000)
Merged from MOODLE_17_STABLE

mod/wiki/ewiki/ewiki.php

index 35be9cd81ca8118c1f9ed82886bcc6900e24c0c8..6fbbcb590174bd8d406d72812bfb0a35046c865b 100644 (file)
@@ -1087,6 +1087,8 @@ function ewiki_page_versions($id=0, $data=0) {
 
 function ewiki_page_search($id, &$data, $action) {
 
+   global $CFG;
+
    $o = ewiki_make_title($id, $id, 2, $action);
 
    if (! ($q = @$_REQUEST["q"])) {
@@ -1099,7 +1101,11 @@ function ewiki_page_search($id, &$data, $action) {
    else {
       $found = array();
 
-      $q = preg_replace('/\s*[^\w]+\s*/', ' ', $q);
+      if ($CFG->unicodedb) {
+          $q = preg_replace('/\s*[\W]+\s*/u', ' ', $q);
+      } else {
+          $q = preg_replace('/\s*[^\w]+\s*/', ' ', $q);
+      }
       foreach (explode(" ", $q) as $search) {
 
          if (empty($search)) { continue; }