File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -89,24 +89,23 @@ public function getTreeJson()
8989 }
9090
9191 /**
92- * Get nested directories without files
92+ * Check if directory has nested directories
9393 *
9494 * @param string $storageRoot
9595 * @param string $fileName
96- * @return array
96+ * @return bool
9797 */
98- private function hasNestedDirectories (string $ storageRoot , string $ fileName ): array
98+ private function hasNestedDirectories (string $ storageRoot , string $ fileName ): bool
9999 {
100- $ result = [];
101100 $ pathList = $ this ->getMediaDirectory ()->read ($ fileName );
102101 foreach ($ pathList as $ directoryPath ) {
103- $ directory = $ this ->_filesystem ->getDirectoryReadByPath ($ storageRoot . $ directoryPath );
104- if (! $ directory ->isDirectory ()) {
105- continue ;
102+ $ file = $ this ->_filesystem ->getDirectoryReadByPath ($ storageRoot . $ directoryPath );
103+ if ($ file ->isDirectory ()) {
104+ return true ;
106105 }
107- $ result [] = $ directoryPath ;
108106 }
109- return $ result ;
107+
108+ return false ;
110109 }
111110
112111 /**
You can’t perform that action at this time.
0 commit comments