Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Commit d734507

Browse files
author
giaphn
committed
- Update HTML Sitemap
1 parent 5788cc9 commit d734507

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Block/Sitemap.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,19 @@ public function getCategoryCollection()
194194

195195
$allExcludeIds = '';
196196
foreach ($excludeCategories as $excludeCategory) {
197-
try {
198-
$testRegex = preg_match($excludeCategory, '');
199-
if ($testRegex) {
200-
$allExcludeIds .= '-' . $this->filterCategoryWithRegex($excludeCategory);
201-
} else {
197+
if (!empty($excludeCategory)) {
198+
try {
199+
$testRegex = preg_match($excludeCategory, '');
200+
if ($testRegex) {
201+
$allExcludeIds .= '-' . $this->filterCategoryWithRegex($excludeCategory);
202+
} else {
203+
$excludePath = $this->getExcludePath($excludeCategory);
204+
$allExcludeIds .= '-' . $this->filterCategoryWithPath($excludePath, $categoryCollection);
205+
}
206+
} catch (Exception $e) {
202207
$excludePath = $this->getExcludePath($excludeCategory);
203208
$allExcludeIds .= '-' . $this->filterCategoryWithPath($excludePath, $categoryCollection);
204209
}
205-
} catch (Exception $e) {
206-
$excludePath = $this->getExcludePath($excludeCategory);
207-
$allExcludeIds .= '-' . $this->filterCategoryWithPath($excludePath, $categoryCollection);
208210
}
209211
}
210212

0 commit comments

Comments
 (0)