4889: ims_import - ensure $sizeofrp is defined before use
authorTJ <acontent@iam.tj>
Mon, 10 Oct 2011 02:28:54 +0000 (03:28 +0100)
committerTJ <acontent@iam.tj>
Wed, 19 Oct 2011 19:11:01 +0000 (20:11 +0100)
home/ims/ims_import.php

index 75a6065..10360dc 100644 (file)
@@ -529,6 +529,7 @@ function removeCommonPath($items){
                        }
 
                        //save the actual content base path
+                       $sizeofrp = array();
                        if (in_array('..', $temp_path)){
                                $sizeofrp = array_count_values($temp_path);
                        }
@@ -548,7 +549,7 @@ function removeCommonPath($items){
                        }
 
                        //real content path
-                       if($sizeofrp['..'] > 0 && !empty($all_package_base_path)){
+                       if(array_key_exists('..', $sizeofrp) && $sizeofrp['..'] > 0 && !empty($all_package_base_path)){
                                for ($i=0; $i<$sizeofrp['..']; $i++){
                                        array_pop($all_package_base_path);
                                }