Skip to content

Commit

Permalink
Merge pull request #3545 from forkcms/dont-copy-empty-images
Browse files Browse the repository at this point in the history
Skip empty images while copying a page
  • Loading branch information
carakas committed Apr 7, 2023
2 parents 1b0d36c + eaf4dd5 commit 9ad5f69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Backend/Modules/Pages/Actions/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,12 @@ function (array $block) {
$url = FRONTEND_FILES_URL . '/Pages/UserTemplate';
foreach ($images as $image) {
$imagePath = $image->getAttribute('src');

// skip empty images
if ($imagePath === '') {
continue;
}

$basename = pathinfo($imagePath, PATHINFO_FILENAME);
$extension = pathinfo($imagePath, PATHINFO_EXTENSION);
$originalFilename = $basename . '.' . $extension;
Expand Down

0 comments on commit 9ad5f69

Please sign in to comment.