<?php
namespace wcf\system\file\upload;
+use wcf\system\WCF;
use wcf\util\FileUtil;
use wcf\util\StringUtil;
*/
private $location;
+ /**
+ * Full image link.
+ * @var string
+ */
+ private $imageLink;
+
/**
* Indicator, whether the file is already processed.
* @var boolean
}
if ($this->processed) {
- return $this->location;
+ if ($this->imageLink === null) {
+ // try to guess path
+ return str_replace(WCF_DIR, WCF::getPath(), $this->location);
+ }
+ else {
+ return $this->imageLink;
+ }
}
else {
$imageData = getimagesize($this->location);
$this->processed = true;
}
+ /**
+ * Sets the new image link of the file for processed files.
+ *
+ * @param string $link
+ */
+ public function setImageLink($link) {
+ $this->imageLink = $link;
+ }
+
/**
* Returns true, if the file is already processed.
*