Skip to content

Commit

Permalink
Merge pull request #216 from ayoub-acx/fix-modified-date-null
Browse files Browse the repository at this point in the history
fix modified date nill
  • Loading branch information
erdnaxelaweb authored Oct 17, 2024
2 parents 90e32ab + b5b9456 commit e52c053
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/SEOBundle/bundle/Controller/SitemapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ protected function fillSitemap(DOMDocument $sitemap, DOMElement $root, SearchRes
continue;
}

$modified = $location->contentInfo->modificationDate->format('c');
$modified = $location->contentInfo->modificationDate ?
$location->contentInfo->modificationDate->format('c') : null;
$loc = $sitemap->createElement('loc', $url);
$lastmod = $sitemap->createElement('lastmod', $modified);
$urlElt = $sitemap->createElement('url');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function run($command): string
'-jar',
$this->jar,
];
$shellCommand = array_merge($shellCommand, explode(" ", $command));
$shellCommand = array_merge($shellCommand, explode(' ', $command));

$process = new Process($shellCommand);
$process->setWorkingDirectory(__DIR__.'/../../../');
Expand Down

0 comments on commit e52c053

Please sign in to comment.