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

Folder with dot/point inside are seen as file #16

Open
advfr opened this issue Jan 11, 2018 · 5 comments · May be fixed by #38
Open

Folder with dot/point inside are seen as file #16

advfr opened this issue Jan 11, 2018 · 5 comments · May be fixed by #38
Labels

Comments

@advfr
Copy link

advfr commented Jan 11, 2018

Hello Hal and thank you for your great job !
Hey ! Am I the only one to see folders containing " . " inside as file, so not opening as a folder ?
Can you try too ?

Thanks !

@halgatewood
Copy link
Owner

halgatewood commented Feb 23, 2018

I am using the default PHP Function is_dir and I'm not sure what it can't handle the dot. I tried a test and the folder doesn't show up anywhere. I may try to look into again in the future, but not sure at the moment.

http://php.net/manual/en/function.is-dir.php

@sneetsher
Copy link

@advfr , you may try replace is_dir($d) with different method test false !== ($f = readdir($d))

source: https://php.net/manual/en/function.is-dir.php#76513

@N0rdmann
Copy link

+1

@beeell1
Copy link

beeell1 commented Feb 21, 2020

I have also encountered this problem some time ago.
It seems that by replacing if( !$file_ext AND is_dir($file)) $file_ext = "dir"; with if( is_dir($file)) $file_ext = "dir"; in function display_block( $file ), the problem goes away.
I think this is due to function ext($filename) returning true if the filename contains a ' . ' regardless of it being a directory or a file.

Hope this helps.

@advfr
Copy link
Author

advfr commented Feb 24, 2020

Hello Thanks you Guys.

Works fine beeell1 !

Thanks a lot !

@m1k1o m1k1o linked a pull request Dec 26, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants