Skip to content

Commit 1f2eb5c

Browse files
authored
Merge pull request #149 from FriendsOfREDAXO/fix-url-exception
sitemap.xml und YDeploy-Aufruf auf direkten Pfad fixieren
2 parents 38f926a + abf1b2f commit 1f2eb5c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lib/Maintenance.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ public static function checkFrontend(): void
207207

208208
// If the sitemap is requested, do not block the request
209209
$REQUEST_URI = rex_server('REQUEST_URI', 'string', '');
210-
if (true === str_contains($REQUEST_URI, 'sitemap.xml')) {
211-
return;
212-
}
213-
214-
// If YDeploy is used, do not block the request
215-
$REQUEST_URI = rex_server('REQUEST_URI', 'string', '');
216-
if (true === str_contains($REQUEST_URI, '_clear_cache/_clear_cache.php')) {
210+
211+
$allowedUris = [
212+
'/_clear_cache/_clear_cache.php',
213+
'/sitemap.xml',
214+
];
215+
216+
// Exclude maintenance mode only for exact paths:
217+
if (in_array($REQUEST_URI, $allowedUris, true)) {
218+
// Maintenance mode NOT active – allow request
217219
return;
218220
}
219221

0 commit comments

Comments
 (0)