Fixed problems with a dots in a filenames

This commit is contained in:
infoneo 2013-05-12 15:22:57 +03:00
parent 8f19c5ecab
commit be4eef682a
1 changed files with 12 additions and 6 deletions

View File

@ -176,16 +176,22 @@ class Mapper
$last= end($pathElements); $last= end($pathElements);
$parts = pathinfo($last); $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 if ((preg_match('~[-\w]+~', $filename)) && (preg_match('~[-\w]+~', $extension))){
$filename = $parts['filename'];
array_pop($pathElements); // rip off the extension ext from last element
array_push($pathElements, $filename); array_pop($pathElements);
array_push($pathElements, $filename);
} else { } else {
unset($parts['extension']); if (isset($parts['extension'])) {
unset($parts['extension']);
}
} }
foreach ($pathElements as $pathElement) { foreach ($pathElements as $pathElement) {