fix: compatibilidad PHP 7.4 — str_starts_with, str_contains, match, never, mixed

This commit is contained in:
Lizandro Guarnizo
2026-06-04 20:04:37 -05:00
parent 943e629120
commit 43f337ee34
5 changed files with 54 additions and 50 deletions
+2 -2
View File
@@ -5,13 +5,13 @@ $base = '';
if (file_exists(__DIR__ . '/.env')) {
foreach (file(__DIR__ . '/.env') as $line) {
$line = trim($line);
if (str_starts_with($line, 'APP_BASE=')) {
if (strpos($line, 'APP_BASE=') === 0) {
$base = rtrim(trim(explode('=', $line, 2)[1]), '/');
break;
}
}
}
if ($base !== '' && str_starts_with($_SERVER['REQUEST_URI'], $base)) {
if ($base !== '' && strpos($_SERVER['REQUEST_URI'], $base) === 0) {
$_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], strlen($base)) ?: '/';
}
require_once __DIR__ . '/public/index.php';