diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2016-10-24 10:38:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-24 10:38:25 +0200 |
commit | ab91fa2660f15102b29254bc1c236101c6dcc6a3 (patch) | |
tree | 248ee35f937ee97a8f5af72935810c4bded21567 /lib/private/Files/View.php | |
parent | 598c145430d813c05b3a980345462c45f801d733 (diff) | |
parent | 7998689bc9eb075813f6ae3ab3025f3932591e95 (diff) | |
download | nextcloud-server-ab91fa2660f15102b29254bc1c236101c6dcc6a3.tar.gz nextcloud-server-ab91fa2660f15102b29254bc1c236101c6dcc6a3.zip |
Merge pull request #1820 from nextcloud/4byte-filenames
Allow 4byte unicode filenames on supported platforms
Diffstat (limited to 'lib/private/Files/View.php')
-rw-r--r-- | lib/private/Files/View.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 79c4d4cabed..f36e2c2c64f 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1806,13 +1806,15 @@ class View { throw new InvalidPathException($l10n->t('Dot files are not allowed')); } - // verify database - e.g. mysql only 3-byte chars - if (preg_match('%(?: + if (!\OC::$server->getDatabaseConnection()->supports4ByteText()) { + // verify database - e.g. mysql only 3-byte chars + if (preg_match('%(?: \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 )%xs', $fileName)) { - throw new InvalidPathException($l10n->t('4-byte characters are not supported in file names')); + throw new InvalidPathException($l10n->t('4-byte characters are not supported in file names')); + } } try { |