create-prisma-php-app 2.0.0-beta.13 → 2.0.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bootstrap.php +4 -4
- package/dist/src/Lib/Request.php +12 -0
- package/package.json +1 -1
package/dist/bootstrap.php
CHANGED
|
@@ -64,7 +64,7 @@ final class Bootstrap
|
|
|
64
64
|
|
|
65
65
|
Request::$pathname = $contentInfo['pathname'] ? '/' . $contentInfo['pathname'] : '/';
|
|
66
66
|
Request::$uri = $contentInfo['uri'] ? $contentInfo['uri'] : '/';
|
|
67
|
-
Request::$decodedUri =
|
|
67
|
+
Request::$decodedUri = Request::getDecodedUrl(Request::$uri);
|
|
68
68
|
|
|
69
69
|
if (is_file(self::$contentToInclude)) {
|
|
70
70
|
Request::$fileToInclude = basename(self::$contentToInclude);
|
|
@@ -675,7 +675,7 @@ final class Bootstrap
|
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
-
$currentUrl =
|
|
678
|
+
$currentUrl = Request::getDecodedUrl(Request::$uri);
|
|
679
679
|
|
|
680
680
|
if (isset($currentData[$currentUrl])) {
|
|
681
681
|
$currentData[$currentUrl]['includedFiles'] = array_values(array_unique(
|
|
@@ -687,7 +687,7 @@ final class Bootstrap
|
|
|
687
687
|
}
|
|
688
688
|
} else {
|
|
689
689
|
$currentData[$currentUrl] = [
|
|
690
|
-
'url' =>
|
|
690
|
+
'url' => Request::$uri,
|
|
691
691
|
'fileName' => self::convertUrlToFileName($currentUrl),
|
|
692
692
|
'isCacheable' => CacheHandler::$isCacheable,
|
|
693
693
|
'cacheTtl' => CacheHandler::$ttl,
|
|
@@ -707,7 +707,7 @@ final class Bootstrap
|
|
|
707
707
|
{
|
|
708
708
|
$url = trim($url, '/');
|
|
709
709
|
$fileName = preg_replace('/[^a-zA-Z0-9-_]/', '_', $url);
|
|
710
|
-
return $fileName
|
|
710
|
+
return $fileName ? mb_strtolower($fileName, 'UTF-8') : 'index';
|
|
711
711
|
}
|
|
712
712
|
|
|
713
713
|
private static function authenticateUserToken(): void
|
package/dist/src/Lib/Request.php
CHANGED
|
@@ -457,4 +457,16 @@ class Request
|
|
|
457
457
|
|
|
458
458
|
exit;
|
|
459
459
|
}
|
|
460
|
+
|
|
461
|
+
public static function getDecodedUrl(string $uri): string
|
|
462
|
+
{
|
|
463
|
+
$parsedUrl = parse_url($uri);
|
|
464
|
+
|
|
465
|
+
$queryString = isset($parsedUrl['query']) ? '?' . urldecode($parsedUrl['query']) : '';
|
|
466
|
+
$path = $parsedUrl['path'] ?? '';
|
|
467
|
+
|
|
468
|
+
$decodedUrl = urldecode($path . $queryString);
|
|
469
|
+
|
|
470
|
+
return $decodedUrl;
|
|
471
|
+
}
|
|
460
472
|
}
|