summaryrefslogtreecommitdiffstats
path: root/lib/private/files/view.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-07-30 11:22:14 +0200
committerLukas Reschke <lukas@owncloud.com>2015-07-30 11:22:14 +0200
commitad4c731c4c4f84f998013c7f4632b23739d16ec4 (patch)
tree46be9cae094071001a17f21b3b3ea4d2c31af2fe /lib/private/files/view.php
parentf1749ddb0184c22200231d7f13f81e64e6000c3b (diff)
downloadnextcloud-server-ad4c731c4c4f84f998013c7f4632b23739d16ec4.tar.gz
nextcloud-server-ad4c731c4c4f84f998013c7f4632b23739d16ec4.zip
Correct regular expressions
Previously the regex was only matching on single characters. Meaning that file names such as ":+1:.txt" where possible while ":+1:" alone never was. This check apparently never worked as expected.
Diffstat (limited to 'lib/private/files/view.php')
-rw-r--r--lib/private/files/view.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index cb3c05d2bca..1a6be73d5bb 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -1656,11 +1656,11 @@ class View {
}
// verify database - e.g. mysql only 3-byte chars
- if (preg_match('%^(?:
+ 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)) {
+)%xs', $fileName)) {
throw new InvalidPathException($l10n->t('4-byte characters are not supported in file names'));
}