{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/6345","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-framework","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/6345/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/6345/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/6345/events","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/6345","id":192250047,"number":6345,"title":"FIX: File::find() should respect case-sensitive filesystems properly","user":{"login":"madmatt","id":893117,"avatar_url":"https://avatars.githubusercontent.com/u/893117?v=3","gravatar_id":"","url":"https://api.github.com/users/madmatt","html_url":"https://github.com/madmatt","followers_url":"https://api.github.com/users/madmatt/followers","following_url":"https://api.github.com/users/madmatt/following{/other_user}","gists_url":"https://api.github.com/users/madmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/madmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madmatt/subscriptions","organizations_url":"https://api.github.com/users/madmatt/orgs","repos_url":"https://api.github.com/users/madmatt/repos","events_url":"https://api.github.com/users/madmatt/events{/privacy}","received_events_url":"https://api.github.com/users/madmatt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-11-29T10:57:32Z","updated_at":"2016-11-30T12:27:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/6345","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/6345","diff_url":"https://github.com/silverstripe/silverstripe-framework/pull/6345.diff","patch_url":"https://github.com/silverstripe/silverstripe-framework/pull/6345.patch"},"body":"Prior to this fix, if you two files with the same case-insensitive filename (e.g. test.jpg and test.JPG), these would be stored correctly on the filesystem and in the database, but when `File::find('test.JPG')` was called, it would return the first matching `File` object, which might point at test.jpg instead of test.JPG.\r\n\r\n`File::find()` now properly respects case-sensitive filesystems. This change does mean that you can't search the database in a case-insensitive manner for files, but I can't see a good use-case for this, even of case-insensitive filesystems."},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/263861799","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/6345#issuecomment-263861799","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/6345","id":263861799,"user":{"login":"dhensby","id":563596,"avatar_url":"https://avatars.githubusercontent.com/u/563596?v=3","gravatar_id":"","url":"https://api.github.com/users/dhensby","html_url":"https://github.com/dhensby","followers_url":"https://api.github.com/users/dhensby/followers","following_url":"https://api.github.com/users/dhensby/following{/other_user}","gists_url":"https://api.github.com/users/dhensby/gists{/gist_id}","starred_url":"https://api.github.com/users/dhensby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhensby/subscriptions","organizations_url":"https://api.github.com/users/dhensby/orgs","repos_url":"https://api.github.com/users/dhensby/repos","events_url":"https://api.github.com/users/dhensby/events{/privacy}","received_events_url":"https://api.github.com/users/dhensby/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T12:27:39Z","updated_at":"2016-11-30T12:27:39Z","body":"How has the system got to the point of having 2 files that are the same name but have different casing if the upload system should detect these collisions anyway?\r\n\r\nIs the bug here that `find` is case insensitive or that your filesystem is in an unexpected state?\r\n\r\nIt is tricky to solve this problem - especially in a patch release and without re-thinking how assets work. Other approaches I can think of would be to ensure all files are named in lowercase on upload - the problem here is that whatever has caused you to have 2 same named files is likely to mean that not all files will be forced to lowercase on upload. I think it's completely unavoidable that if the filesystem and DB are out of sync that we will encounter inconsistent \r\n\r\nI'm not a fan of adding a `$strict` flag and this change is a behaviour change, so we'd have to be cautious about which release it goes into... It may be best to patch secureassets first and then we think of a long-term fix for core."}}
{"actor":{"display_login":"dhensby"}}