$pathElements =
explode('/',
$path);
$pathInfo =
pathinfo($path);
$md5hash =
md5($path);
if (empty($pathInfo['extension'
])) { return '';
} $realPath = \
array_slice(str_split($md5hash, 2
), 0, 3
);
$realPath =
$pathElements[0
] . '/' .
$pathElements[1
] . '/' .
implode('/',
$realPath) . '/' .
$pathInfo['basename'
];
if (!
$this->
hasBlacklistParts($realPath)) { return $realPath;
} foreach ($this->blacklist
as $key =>
$value) { // must be called 2 times, because the second level won't be matched in the first call
$realPath =
str_replace($key,
$value,
$realPath);
$realPath =
str_replace($key,
$value,
$realPath);
} return $realPath;
}