- private function checks($rawdata, $fullpath, $absolute_path) {
- $fullpath = urldecode($fullpath);
-
- if (file_exists($fullpath)) {
- unlink($fullpath);
+ /**
+ * Process a single image:
+ * - retrieve it
+ * - re-saved it (for security reason)
+ * - return the new local path.
+ *
+ * @param int $entryId ID of the entry
+ * @param string $imagePath Path to the image to retrieve
+ * @param string $url Url from where the image were found
+ * @param string $relativePath Relative local path to saved the image
+ *
+ * @return string Relative url to access the image from the web
+ */
+ public function processSingleImage($entryId, $imagePath, $url, $relativePath = null)
+ {
+ if (null === $relativePath) {
+ $relativePath = $this->getRelativePath($entryId);