4888: ims_import.php: prevent "Undefined index: type in checkResources()
authorTJ <acontent@iam.tj>
Mon, 10 Oct 2011 15:13:36 +0000 (16:13 +0100)
committerTJ <acontent@iam.tj>
Wed, 19 Oct 2011 19:10:23 +0000 (20:10 +0100)
home/ims/ims_import.php

index 1ecf8e8..785dc24 100644 (file)
@@ -237,7 +237,7 @@ function checkResources($import_path){
                }
 
                //validate the xml by its schema
-               if (preg_match('/imsqti\_(.*)/', $fileinfo['type'])){
+               if (isset($fileinfo['type']) && preg_match('/imsqti\_(.*)/', $fileinfo['type'])){
                        $qti = new QTIParser($fileinfo['type']);
                        $xml_content = @file_get_contents($import_path . $fileinfo['href']);
                        $qti->parse($xml_content); //will add error to $msg if failed