mirror of
https://github.com/nextcloud/server.git
synced 2026-03-08 18:28:16 +01:00
Fixed problems with a dots in a filenames
This commit is contained in:
@@ -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'];
|
||||
|
||||
|
||||
// rip off the extension ext from last element
|
||||
$filename = $parts['filename'];
|
||||
array_pop($pathElements);
|
||||
array_push($pathElements, $filename);
|
||||
if ((preg_match('~[-\w]+~', $filename)) && (preg_match('~[-\w]+~', $extension))){
|
||||
|
||||
// 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) {
|
||||
|
||||
Reference in New Issue
Block a user