Closed DennoDin closed 2 years ago
If php's own file_exists
fails because the path you provide is invalid, then you need to sanitize your file path and fix that before handing it to this zipping library.
Not sure I understand how it potentially removes data someone might want? If the null character effectively means the path is invalid and not found, why would anyone want that data?
I believe that your approach of fixing your file path and ensuring it is accurate before passing to the add
method is the correct one. Closing this for now.
This package's
add
method fails if the stream provided in$source
contains a null character. When it reaches thefile_exists()
inside the if statement insrc/Models/File.php
on line 62, the app will throw an error.I've fixed the issue in my own code by cleaning the stream before passing it to the
add
method, replacing null characters with an empty string. I don't know if that's how you want to fix it since it potentially removes data someone might want.