]> git.mjollnir.org Git - moodle.git/commitdiff
Improved regep for category switching
authorthepurpleblob <thepurpleblob>
Fri, 1 Dec 2006 16:06:06 +0000 (16:06 +0000)
committerthepurpleblob <thepurpleblob>
Fri, 1 Dec 2006 16:06:06 +0000 (16:06 +0000)
question/format/gift/format.php

index c48b6d4bb963128be686f4578a88e9e3d05e108c..6d23a28dd7bc54a5a0be19400b24904e8073523f 100755 (executable)
@@ -143,7 +143,7 @@ class qformat_gift extends qformat_default {
         $text = $this->escapedchar_pre($text);
 
         // Look for category modifier
-        if (ereg( '^\$CATEGORY:(.+)', $text, $matches)) {
+        if (ereg( '^\$CATEGORY: *([A-Za-z0-9/]+)[[:space:]]', $text, $matches)) {
             $newcategory = $matches[1];
 
             // build fake question to contain category