Skip to content

Commit

Permalink
Simplified initialization logic by removing unnecessary path manipula…
Browse files Browse the repository at this point in the history
…tion and improving error message clarity.
  • Loading branch information
Tastaturberuf committed Feb 28, 2025
1 parent f45a4d5 commit cb368f6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ajax/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* anyStores for Contao Open Source CMS
*
* @copyright (c) 2015 - 2016 Tastaturberuf <[email protected]>
* @copyright (c) 2015 - 2025 Tastaturberuf <[email protected]>
* @author Daniel Jahnsmüller <[email protected]>
* @license http://opensource.org/licenses/lgpl-3.0.html
* @package anyStores
Expand All @@ -16,15 +16,11 @@
define('TL_MODE', 'FE');
define('TL_SCRIPT', __FILE__);

$file = dirname(__DIR__) . 'initialize.php';

$remove = 'modules' . DIRECTORY_SEPARATOR . 'anyStores';

$file = str_replace($remove, '', $file);
$file = str_replace('vendor/tastaturberuf/anystores', 'system/initialize.php', dirname(__DIR__));

if (!file_exists($file)) {
http_response_code(404);
die('404 Not Found. Have you renamed the module folder? MUST be `anyStores`.');
die('404 Not Found');
}

require $file;
Expand Down

0 comments on commit cb368f6

Please sign in to comment.