Repository navigation
fix problems with german "Umlaut" in folder name - #3459
Conversation
There was a problem hiding this comment.
utf8_encode converts ISO-8859-1 to UTF-8. Can we assume safely that readdir() will always return ISO-8859-1 encoded strings on all systems, including Windows?
|
without any unit test this is a too critical change. |
|
We use readdir in multiple locations. I think this needs to be solved in a different manner. |
|
Yes. You are right @MTGap |
|
The view class wraps the php functions for local storage. |
|
After I've looked at the problem again, I must admit that my initial approach was wrong. |
|
Now we've just got normalizing occurring in different places: https://github.com/owncloud/core/blob/master/lib/files/filesystem.php#L600 |
|
@icewind1991 using Filesystem::normalizePath instead of Cache::normalizePath may break some logic, so I suppose using Cache::normalize instead, what you think? |
|
@DeepDiver1975 I tested the normalizer https://github.com/nicolas-grekas/Patchwork-UTF8/blob/master/class/Patchwork/PHP/Shim/Normalizer.php locally in my tests it works like the normalizer provided by php-intl. |
|
@FlorinPeter THX for testing this! Awesome! |
|
@karlitschek looks like we have a working fallback for the normalizer |
|
Yay :-) |
I assume we should go for that solution? 😄 @FlorinPeter interested in submitting a pull request to the 3rdparty repo to add the patchwork normalizer? @icewind1991 @danimo @bartv2 I'd still like to see your comments on this stuff - THX |
|
ok I did some work, we need this owncloud-archive/3rdparty#32 merged so jenkins can test it |
|
@owncloud-bot retest this please |
|
@DeepDiver1975 thx, Jenkins seems also excited about it ;) |
|
@icewind1991 can you please review this? THX |
There was a problem hiding this comment.
what about the function getParentId() - do we need to normalize $path there as well?
There was a problem hiding this comment.
and within move() $source is used in the select query without normalize call
same for $target in the update statement
There was a problem hiding this comment.
in getStatus() $file is not normalized
There was a problem hiding this comment.
@DeepDiver1975 getParentId() is calling getId and there the $path get's normalized. I Think we need normalizing everywhere we use md5() to prevent duplicate path_hash. As I can see a un-normalized string in a sql query is always normalized by the database, but for this case I will provide a unit test, so we can be sure.
|
The get functions in the cache should already have their paths normalized, because it should be going through the filesystem. I believe the only issue is with the return with readdir as was in the original commit. I think we should use OC\Files\Stream\Dir for all the opendir calls so that we can normalize the returns of readdir. |
I'm planning to deprecate the opendir stuff with the new filesystem stuff and use a higer level api for it instead. I think doing normalization in OC_Filesystem::normalizePath would be better |
|
@alexisvincent like I said before this branch is not for productional use, it is only for testing this issue. |
|
@DeepDiver1975 @icewind1991 @MTGap @karlitschek please review, THX |
|
I'm fine with the code now 👍 |
|
Looks good to me 👍 |
fix problems with german "Umlaut" in folder name
|
Should we backport this? From my perspective I would say yes what do you think? @DeepDiver1975 @icewind1991 @karlitschek |
|
I'd keep this as a new feature for OC6 |
|
Please backport it. For me it would mean a lot. And from my perspective (prehaps flawed) this is a bug that needs fixing (reason to fix in OC5) and not just a new feature for OC6. |
|
I would like to ASK to backport it in OC5, too. |
|
Btw, I mentioned this to @DeepDiver1975 the other day and I should repeat it here: This patch does not make ownCloud fit for use with OS X. Mac OS X's HFS+ partition are only case preserving ("Foo" != "foo"), but not case sensitive ("Foo" and "foo" can coexist in the same directory) by default. We either need to mandate OS X users to have ownCloud's data storage on a case sensitive partition (and check for it), or still perform some kind of mapping, similar how we do it on Windows today (just to complete the fun, it is also possible to have case insensitive file systems on Linux, e.g. JFS or (more likely) a CIFS-mounted local or remote storage. |
|
hmm :/ so would it work if i made a FAT32 partition on the mac server and put the owncloud installation in there... With this fix? Or prehaps another fs? @danimo |
|
@alexisvincent erm, FAT32 is also just case preserving. What you would need to do is create a DMG file with HFS+ with the case sensitivity flag set, then mount it and use it to store the data folder. |
|
Hmm. ok thanks for the advice. Just out of interests sake. how stable do you think it would be using a DMG 24/7? |
|
I think a DMG will be as stable as the drive is stabe where it resides on. But this is somehow another discussion. |
|
....and I hate the auto-correction :-( |
|
Thanks. I think ill just make a case sensitive partition :) any information on a back port? Sorry if im being a pain about this.. @karlitschek |
|
This needs more testing before backporting because it could trigger major unforeseen bugs. |
|
Does this means that more tests will be done? I would appreciate if a backport could be done for OC5 |
|
@karlitschek first of all 🎂 for you 😉 We had quite some testing of that code now within git master - shall we backport this now? THX |
|
THX :-) |
I'll take care asap |
|
backported to stable5 |
|
I was having an issue with the OC client on mac os x, it connects to my server which is a mac os x mountain lion install with the owncloud core as noted here: As such I noticed that I was having issues with the accented characters, and I realize that OwnCloud isn't supported to be run on OS X, but I was working with an install before the accented characters issue was realized. I also saw that these threads were dealing with this issue possibly: I have some information that might help towards a solution that I found, and you might already know about it but I would check it out regardless it is here: |
This PR fix the problem with german "Umlaut" in folder name on mac os (#2377 and #579).
The problem was that the mac os filesystem character encoding is http://en.wikipedia.org/wiki/Macintosh_Roman so we need utf8 encoding because the webinterface is utf8.