Skip to content

Commit

Permalink
Fix the Override issue on Windows WAMP server
Browse files Browse the repository at this point in the history
This fixes the Error 0 with template Zero on Windows WAMP server
  • Loading branch information
w4tchout authored Aug 28, 2024
1 parent e308175 commit 1b4b1e7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions framework/library/astroid/Helper/Overrides.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private static function generateExtensionPath(string $path) : string {
return '';
}

$path = explode('/', trim($path, '/'));
$path = explode(DIRECTORY_SEPARATOR, trim($path, DIRECTORY_SEPARATOR));

$version = JVERSION;
$extension = $path[0];
Expand All @@ -35,12 +35,12 @@ private static function generateExtensionPath(string $path) : string {
else {
\array_splice($path, 1, 0, ['tmpl']);
}
return JPATH_ROOT . '/components/' . \implode('/', $path);
return JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . \implode(DIRECTORY_SEPARATOR, $path);
}

elseif (\strpos($extension, 'mod_') === 0) {
\array_splice($path, 1, 0, ['tmpl']);
return JPATH_ROOT . '/modules/' . \implode('/', $path);
return JPATH_ROOT . DIRECTORY_SEPARATOR. 'modules' . DIRECTORY_SEPARATOR . \implode(DIRECTORY_SEPARATOR, $path);
}

elseif (\strpos($extension, 'plg_') === 0) {
Expand All @@ -49,13 +49,13 @@ private static function generateExtensionPath(string $path) : string {
\array_push($pluginPath, 'tmpl');

\array_splice($path, 0, 1, $pluginPath);
return JPATH_ROOT . '/plugins/' . \implode('/', $path);
return JPATH_ROOT . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . \implode(DIRECTORY_SEPARATOR, $path);
}
elseif ($extension === 'layouts') {
return JPATH_ROOT . '/' . \implode('/', $path);
return JPATH_ROOT . DIRECTORY_SEPARATOR . \implode(DIRECTORY_SEPARATOR, $path);
}

return \implode('/', $path);
return \implode(DIRECTORY_SEPARATOR, $path);
}

public static function getHTMLTemplate(): string
Expand Down

0 comments on commit 1b4b1e7

Please sign in to comment.