Skip to content

Over aggressive filtering in JFolder::makePathSafe #183

ianmacl opened this Issue Aug 5, 2011 · 3 comments

5 participants

ianmacl commented Aug 5, 2011
    $regex = array('#[^A-Za-z0-9:_\\\/-]#');
    return preg_replace($regex, '', $path);

For general purpose use we need to be more permissive than that. Particularly, we should at least allow folder names with periods in them.


I think that makes sense Ian, are there any other characters that you think would be important to have? I mean ultimately the method is designed to provide a least common denominator across platforms for a safe path. That being said the colon is probably not a great thing to have in that character class anyway.


"." is used in front of a folder in linux to make it a hidden folder. I think that it isn't allowed to use the period, because the result of the name will depend on the OS. Can this be considered as a bug ?

elinw commented May 14, 2012

see #1067

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.