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)
This commit is contained in:
stronk7
2006-01-15 11:55:59 +00:00
parent 9250c7f917
commit fe36756ae0
+4 -1
View File
@@ -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"));