From 3a8e75a814a8c6b394d28570e15ccd85ad57dced Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 20 Oct 2016 14:26:09 +0200 Subject: Allow 4byte unicode filenames on supported platforms Signed-off-by: Robin Appelman --- lib/private/Files/View.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/private/Files/View.php') diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index fa6ba20c342..56d7b716265 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 { -- cgit v1.2.3