Commit a647f84c authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Check blog upload directory exists before reading it

parent 601e8fbf
......@@ -126,6 +126,7 @@ function xmldb_artefact_blog_upgrade($oldversion=0) {
if ($oldversion < 2009033100) {
$bloguploadbase = get_config('dataroot') . 'artefact/blog/uploads/';
if (is_dir($bloguploadbase)) {
if ($basedir = opendir($bloguploadbase)) {
while (false !== ($sessionupload = readdir($basedir))) {
if ($sessionupload != "." && $sessionupload != "..") {
......@@ -145,6 +146,7 @@ function xmldb_artefact_blog_upgrade($oldversion=0) {
}
@rmdir($bloguploadbase);
}
}
return true;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment