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()
89
89
}
90
90
91
91
/**
92
- * Get nested directories without files
92
+ * Check if directory has nested directories
93
93
*
94
94
* @param string $storageRoot
95
95
* @param string $fileName
96
- * @return array
96
+ * @return bool
97
97
*/
98
- private function hasNestedDirectories (string $ storageRoot , string $ fileName ): array
98
+ private function hasNestedDirectories (string $ storageRoot , string $ fileName ): bool
99
99
{
100
- $ result = [];
101
100
$ pathList = $ this ->getMediaDirectory ()->read ($ fileName );
102
101
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 ;
106
105
}
107
- $ result [] = $ directoryPath ;
108
106
}
109
- return $ result ;
107
+
108
+ return false ;
110
109
}
111
110
112
111
/**
You can’t perform that action at this time.
0 commit comments