Use random hash in template image filename
[MAILPOET-2686]
This commit is contained in:
committed by
Veljko V
parent
0113402bce
commit
ab23b06ff8
@@ -4,6 +4,7 @@ namespace MailPoet\NewsletterTemplates;
|
||||
|
||||
use MailPoet\Config\Env;
|
||||
use MailPoet\Entities\NewsletterTemplateEntity;
|
||||
use MailPoet\Util\Security;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class ThumbnailSaver {
|
||||
@@ -75,7 +76,7 @@ class ThumbnailSaver {
|
||||
if (!file_exists($thumbNailsDirectory)) {
|
||||
$this->wp->wpMkdirP($thumbNailsDirectory);
|
||||
}
|
||||
$file = $thumbNailsDirectory . '/' . uniqid() . '_template_' . $template->getId() . '.jpg';
|
||||
$file = $thumbNailsDirectory . '/' . Security::generateHash(16) . '_template_' . $template->getId() . '.jpg';
|
||||
if ($this->compressAndSaveFile($file, $data)) {
|
||||
$url = str_replace($this->baseDirectory, $this->baseUrl, $file);
|
||||
$template->setThumbnail($url);
|
||||
|
Reference in New Issue
Block a user