From fe36756ae07608932b8ea8ddb3184624a4585e4e Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sun, 15 Jan 2006 11:55:59 +0000 Subject: [PATCH] Now ewiki supports initial load of contents from course file area. Original preg_match() was a bit strange so I've replaced it with clean_filename() + !is_dir() check. Bug 3830. (http://moodle.org/bugs/bug.php?op=show&bugid=3830) --- mod/wiki/ewiki/ewiki.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/wiki/ewiki/ewiki.php b/mod/wiki/ewiki/ewiki.php index 87b59aa6bb0..5c3170833e2 100644 --- a/mod/wiki/ewiki/ewiki.php +++ b/mod/wiki/ewiki/ewiki.php @@ -3164,7 +3164,10 @@ function ewiki_eventually_initialize(&$id, &$data, &$action) { if (!empty($path)) { if ($dh = @opendir($path=EWIKI_INIT_PAGES)) { while ($filename = readdir($dh)) { - if (preg_match('/^(['.EWIKI_CHARS_U.']+['.EWIKI_CHARS_L.']+\w*)+/', $filename)) { +#### MOODLE CHANGE TO SOLVE BUG #3830. Original doesn't support dots in names. + //Orig->if (preg_match('/^(['.EWIKI_CHARS_U.']+['.EWIKI_CHARS_L.']+\w*)+/', $filename)) { + if ($filename == clean_filename($filename) && !is_dir($path.'/'.$filename)) { +#### END OF MOODLE CHANGE TO SOLVE BUG #3830. Original doesn't support dots in names. $found = ewiki_database("FIND", array($filename)); if (! $found[$filename]) { $content = implode("", file("$path/$filename"));