// prepare path
$fileExtension = pathinfo($url, PATHINFO_EXTENSION);
$fileLocation = WCF_DIR.'images/proxy/'.substr($fileName, 0, 2).'/'.$fileName.($fileExtension ? '.'.$fileExtension : '');
- $imageData = getimagesize($fileLocation);
$dir = dirname($fileLocation);
if (!@file_exists($dir)) {
FileUtil::makePath($dir);
// update mtime for correct expiration calculation
@touch($fileLocation);
}
+ else {
+ $imageData = getimagesize($fileLocation);
+ }
$this->executed();
@header('Content-Type: '.$imageData['mime']);