-
Notifications
You must be signed in to change notification settings - Fork 68
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
DB query in File::find($filepath) should be case-sensitive #493
Comments
Makes sense, though I wonder how many files would suddenly become missing... |
I think a safer implementation would be to not allow duplicate file names (by case) - I'm surprised this is even possible 🤔 |
None should go missing (unless there's somehow a discrepancy between filenames in the DB and on the filesys, but that could be considered a data-integrity issue which should be fixed anyway/elsewhere?). If however issues like files gone missing are indeed to be expected maybe we could fallback to case-insensitive query if no records are found via case-sensitive? |
Safer implementation possibly, but not a correction of this issue imo :-) This situation is possible when loading files into File dataobjects manually (for example when checking for existing files via Also I did notice what I think is at least one occurence of this issue in CMS-uploaded files as well. |
Historically I know case-sensitivity (including database sensitivity) has been considered quite a bit around files. We should try to find the historical decisions around this. We need to remember that we are a framework that should be striving to provide interoperability regardless of the case-sensitivity of the filesystem being used. That must be the priority, if that means not allowing files to share names regardless of case, then that's what we should do (if that's decided to be the best approach). |
My-FILE.jpg
andMy-file.jpg
) on a case-sensitive filesystem (as any webserver should be).File::find('My-file.jpg)
will (wrongly) return theMy-FILE.jpg
record if that file/record was created earlier.Proposed fix: make
File::find()
case-sensitive by applying the:case
searchfilter on theName
query;The text was updated successfully, but these errors were encountered: