Skip to content

Commit 6425e3d

Browse files
committed
AC-1065: Added validations on choosing image name with Adobe Stock
1 parent 68e216c commit 6425e3d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

AdobeStockImage/Model/SaveImage.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ public function __construct(
7272
public function execute(Document $document, string $url, string $destinationPath): void
7373
{
7474
try {
75+
if (!preg_match('/^[a-zA-Z0-9\.\-\_\/\s]+$/i', $destinationPath)) {
76+
throw new LocalizedException(__('Image File has invalid characters.'));
77+
}
7578
$this->saveFile->execute($document, $url, $destinationPath);
7679
$mediaAssetId = $this->saveMediaGalleryAsset->execute($document, $destinationPath);
7780

0 commit comments

Comments
 (0)