fix: compatibilidad PHP 7.4 — str_starts_with, str_contains, match, never, mixed
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user