Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfoneo <infoneo@yahoo.pl>2013-05-12 16:22:57 +0400
committerinfoneo <infoneo@yahoo.pl>2013-05-12 16:22:57 +0400
commitbe4eef682ae515fd542ec351eef05cc54fe3247c (patch)
treee8d4449d1ffe2b5e0dcb924d94054c72c2941007 /lib/files/mapper.php
parent8f19c5ecab7058702882aa3db4d3202ca697cb70 (diff)
Fixed problems with a dots in a filenames
Diffstat (limited to 'lib/files/mapper.php')
-rw-r--r--lib/files/mapper.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/files/mapper.php b/lib/files/mapper.php
index 97a2bff915a..d9e116bf25b 100644
--- a/lib/files/mapper.php
+++ b/lib/files/mapper.php
@@ -176,16 +176,22 @@ class Mapper
$last= end($pathElements);
$parts = pathinfo($last);
- if ((preg_match('~[-\w]+~', $parts['filename'])) && (preg_match('~[-\w]+~', $parts['extension']))){
+ $filename = $parts['filename'];
+ $extension = $parts['extension'];
+
+
+ if ((preg_match('~[-\w]+~', $filename)) && (preg_match('~[-\w]+~', $extension))){
- // rip off the extension ext from last element
- $filename = $parts['filename'];
- array_pop($pathElements);
- array_push($pathElements, $filename);
+ // rip off the extension ext from last element
+ array_pop($pathElements);
+ array_push($pathElements, $filename);
} else {
- unset($parts['extension']);
+ if (isset($parts['extension'])) {
+ unset($parts['extension']);
+ }
+
}
foreach ($pathElements as $pathElement) {