Skip to content

Commit

Permalink
fix: try to fix windows issue with ajax endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Oct 28, 2024
1 parent fc6ba6c commit 5120f66
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ private function ajaxEndpoints(): array
foreach ($this->ajaxFolders as $baseurl => $folder) {
$endpoints = $this->wire->files->find($folder, $opt);
foreach ($endpoints as $endpoint) {
// Normalize paths to use forward slashes
$endpoint = Paths::normalizeSeparators($endpoint);
$folder = Paths::normalizeSeparators($folder);

// remove endpoint file extension
$url = $baseurl . substr($endpoint, strlen($folder), - (strlen($ext) + 1));
if (array_key_exists($url, $arr)) continue;
Expand Down

0 comments on commit 5120f66

Please sign in to comment.