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

Wrapper.php打开带目录的文件 opendir返回false或者少一字 #4

Open
illuminatorSlab opened this issue Jul 8, 2017 · 0 comments

Comments

@illuminatorSlab
Copy link

排查了一下原因应该是第32行dir_opendir函数内

if (substr($this->url['path'], -1) == '/') $pathlen++;

多余了,导致readdir中截取的子文件名都是从第二个字符开始的

以及第35行的截取文件名操作

if ($pathlen > 0) $file['name'] = substr($file['name'], $pathlen);

对于根文件夹而言无法截取字符串,会导致根文件夹名值为false
建议对根文件夹名的截取返回值改为 “.” 以实现近似打开文件系统的效果

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

1 participant