Fix code layout before fixing the function
This commit is contained in:
parent
6a7be8a36a
commit
b861e1d696
|
@ -183,8 +183,6 @@ class Mapper
|
||||||
$pathElements = explode('/', $path);
|
$pathElements = explode('/', $path);
|
||||||
$sluggedElements = array();
|
$sluggedElements = array();
|
||||||
|
|
||||||
$last= end($pathElements);
|
|
||||||
|
|
||||||
foreach ($pathElements as $pathElement) {
|
foreach ($pathElements as $pathElement) {
|
||||||
// remove empty elements
|
// remove empty elements
|
||||||
if (empty($pathElement)) {
|
if (empty($pathElement)) {
|
||||||
|
@ -205,7 +203,6 @@ class Mapper
|
||||||
// if filename doesn't contain periods add index ofter the last char
|
// if filename doesn't contain periods add index ofter the last char
|
||||||
array_push($sluggedElements, $last . '-' . $index);
|
array_push($sluggedElements, $last . '-' . $index);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sluggedPath = $this->unchangedPhysicalRoot . implode('/', $sluggedElements);
|
$sluggedPath = $this->unchangedPhysicalRoot . implode('/', $sluggedElements);
|
||||||
|
@ -218,8 +215,7 @@ class Mapper
|
||||||
* @param string $text
|
* @param string $text
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function slugify($text)
|
private function slugify($text) {
|
||||||
{
|
|
||||||
// replace non letter or digits or dots by -
|
// replace non letter or digits or dots by -
|
||||||
$text = preg_replace('~[^\\pL\d\.]+~u', '-', $text);
|
$text = preg_replace('~[^\\pL\d\.]+~u', '-', $text);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue