Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php 8.0 error #302

Open
speefak opened this issue May 11, 2022 · 1 comment
Open

php 8.0 error #302

speefak opened this issue May 11, 2022 · 1 comment

Comments

@speefak
Copy link

speefak commented May 11, 2022

using php8.0 or newer the import dialog hangs when choosing the import image. There is no path or filesystem hierarchy shown. The loading symbol just turns around.

@PodJIgaeFF
Copy link

diff --git a/endpoints/jqueryFileTree.php b/endpoints/jqueryFileTree.php
index 875d3db..96c9d8d 100644
--- a/endpoints/jqueryFileTree.php
+++ b/endpoints/jqueryFileTree.php
@@ -222,7 +222,8 @@ echo(json_encode($returnData));
  * Get directory entries
  */
 function getdir($dir, $dirsOnly=false, $recurse=array()) {
-
+       global $allowed_exts;
+
        if(!$dir) $dir = DSEP;

        $entries = getDirEntries($dir, $dirsOnly);
@@ -251,9 +252,9 @@ function getdir($dir, $dirsOnly=false, $recurse=array()) {
                // Push file on to stack
                } else {

-                       $ext = strtolower(preg_replace('/^.*\./', '', $file));
+                       $ext = strtolower(preg_replace('/^.*\./', '', $path));

-                if(count($allowed) && !$allowed['.'.$ext]) continue;
+                if(count($allowed_exts) && !$allowed_exts['.'.$ext]) continue;

                 array_push($dirents, file_entry($path));
                }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants