MDL-22546 do not accept bogus params in fulldelete()
authorPetr Skoda <skodak@moodle.org>
Sat, 22 May 2010 21:40:03 +0000 (21:40 +0000)
committerPetr Skoda <skodak@moodle.org>
Sat, 22 May 2010 21:40:03 +0000 (21:40 +0000)
lib/filelib.php

index c46e041..53a9895 100644 (file)
@@ -2084,6 +2084,10 @@ function put_records_csv($file, $records, $table = NULL) {
  * @return bool
  */
 function fulldelete($location) {
+    if (empty($location)) {
+        // extra safety against wrong param
+        return false;
+    }
     if (is_dir($location)) {
         $currdir = opendir($location);
         while (false !== ($file = readdir($currdir))) {