@@ -102,11 +102,13 @@ protected static function initPath($path, $streamType, $storeOpenContext = false
102
102
register_shutdown_function (array ("fsAccessWrapper " , "removeTmpFile " ), $ tmpDir , $ tmpFileName );
103
103
$ crtZip = new PclZip (AJXP_Utils::securePath ($ resolvedPath .$ repoObject ->resolveVirtualRoots ($ zipPath )));
104
104
$ content = $ crtZip ->listContent ();
105
- foreach ($ content as $ item ) {
106
- $ fName = AJXP_Utils::securePath ($ item ["stored_filename " ]);
107
- if ($ fName == $ localPath || "/ " .$ fName == $ localPath ) {
108
- $ localPath = $ fName ;
109
- break ;
105
+ if (is_array ($ content )){
106
+ foreach ($ content as $ item ) {
107
+ $ fName = AJXP_Utils::securePath ($ item ["stored_filename " ]);
108
+ if ($ fName == $ localPath || "/ " .$ fName == $ localPath ) {
109
+ $ localPath = $ fName ;
110
+ break ;
111
+ }
110
112
}
111
113
}
112
114
$ res = $ crtZip ->extract (PCLZIP_OPT_BY_NAME , $ localPath , PCLZIP_OPT_PATH , $ tmpDir , PCLZIP_OPT_REMOVE_ALL_PATH );
@@ -125,6 +127,7 @@ protected static function initPath($path, $streamType, $storeOpenContext = false
125
127
} else {
126
128
$ crtZip = new PclZip (AJXP_Utils::securePath ($ resolvedPath .$ repoObject ->resolveVirtualRoots ($ zipPath )));
127
129
$ liste = $ crtZip ->listContent ();
130
+ if (!is_array ($ liste )) $ liste = array ();
128
131
if ($ storeOpenContext ) self ::$ crtZip = $ crtZip ;
129
132
$ folders = array (); $ files = array ();$ builtFolders = array ();
130
133
if ($ localPath [strlen ($ localPath )-1 ] != "/ " ) $ localPath .="/ " ;
0 commit comments