public function resolve($name)
{
if ($this->isLfiProtectionOn() && preg_match('#\\.\\.[\\\\/]#', $name)) {
return null;
}
foreach ($this->aliases as $alias => $path) {
if (strpos($name, $alias) === false) {
continue;
}
$filename = substr_replace($name, '', 0, strlen($alias));
$file = new SplFileInfo($path . $filename);
if ($file->isReadable() && !$file->isDir()) {
$filePath = $file->getRealPath();
$mimeType = $this->getMimeResolver()->getMimeType($filePath);
$asset = new FileAsset($filePath);
$asset->mimetype = $mimeType;
return $asset;
}
}
return null;
}