Mimetype detection for hidden files#3212
Merged
icewind1991 merged 2 commits intonextcloud:masterfrom Jan 23, 2017
Merged
Conversation
Signed-off-by: Magnus Walbeck <mw@mwalbeck.org>
|
@mwalbeck, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rullzer, @LukasReschke and @icewind1991 to be potential reviewers. |
icewind1991
requested changes
Jan 23, 2017
Member
icewind1991
left a comment
There was a problem hiding this comment.
Otherwise I'm ok with this change
| $fileName = basename($path); | ||
|
|
||
| // remove leading dot on hidden files with a file extension | ||
| if (strpos($fileName, '.') === 0 && strpos($fileName, '.', 1)) { |
Member
There was a problem hiding this comment.
$fileName = ltrim($fileName, '.');should do the trick 😄
Current coverage is 53.97% (diff: 100%)@@ master #3212 diff @@
==========================================
Files 1298 1298
Lines 80110 80111 +1
Methods 7910 7910
Messages 0 0
Branches 1248 1248
==========================================
- Hits 43239 43238 -1
- Misses 36871 36873 +2
Partials 0 0
|
Signed-off-by: Magnus Walbeck <mw@mwalbeck.org>
icewind1991
approved these changes
Jan 23, 2017
nickvergessen
approved these changes
Jan 23, 2017
Member
nickvergessen
left a comment
There was a problem hiding this comment.
Nice, but this only works for new files right? Old files still have the wrong entry in the database?
Contributor
Author
|
Correct, old files will still have the wrong mimetype in the filecache. |
Member
|
iirc there is a repair command to fix mimetypes, not sure if it's applicable here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #3183
Would this work?