Skip to content

Commit

Permalink
fix: latte files not working in ajax endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Oct 2, 2024
1 parent 3cd8809 commit 3e6e8a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,8 @@ private function ajaxEndpoints(): array
foreach ($this->ajaxFolders as $baseurl => $folder) {
$endpoints = $this->wire->files->find($folder, $opt);
foreach ($endpoints as $endpoint) {
$url = $baseurl . substr($endpoint, strlen($folder), -4);
// remove endpoint file extension
$url = $baseurl . substr($endpoint, strlen($folder), - (strlen($ext) + 1));
if (array_key_exists($url, $arr)) continue;
$arr[$url] = $endpoint;
}
Expand Down

0 comments on commit 3e6e8a1

Please sign in to comment.