--- file.php	2011-02-03 12:07:24.000000000 -0500
+++ file.php	2011-02-03 12:06:59.000000000 -0500
@@ -124,8 +124,11 @@
     }
 
     // security: force download of all attachments submitted by students
-    if (count($args) >= 3 and strtolower($args[1]) === 'moddata') {
+    if (count($args) > 3 and strtolower($args[1]) === 'moddata') {
         $mod = clean_param($args[2], PARAM_SAFEDIR);
+        if (rtrim($mod, '0123456789') == 'wiki') {
+            $mod = 'wiki';
+        }
         if (file_exists("$CFG->dirroot/mod/$mod/lib.php")) {
             if (!$forcedownload) {
                 require_once("$CFG->dirroot/mod/$mod/lib.php");
