Skip to content

Commit de1bf04

Browse files
committed
fix for #749
1 parent 9fbe671 commit de1bf04

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

api.include.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7467,7 +7467,7 @@ private function isOriginAllowed(string $origin, string $allowedOrigins): bool
74677467
{
74687468
$found = false;
74697469
foreach (explode(',', $allowedOrigins) as $allowedOrigin) {
7470-
$hostname = preg_quote(strtolower(trim($allowedOrigin)));
7470+
$hostname = preg_quote(strtolower(trim($allowedOrigin)),'/');
74717471
$regex = '/^' . str_replace('\*', '.*', $hostname) . '$/';
74727472
if (preg_match($regex, $origin)) {
74737473
$found = true;

api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7467,7 +7467,7 @@ private function isOriginAllowed(string $origin, string $allowedOrigins): bool
74677467
{
74687468
$found = false;
74697469
foreach (explode(',', $allowedOrigins) as $allowedOrigin) {
7470-
$hostname = preg_quote(strtolower(trim($allowedOrigin)));
7470+
$hostname = preg_quote(strtolower(trim($allowedOrigin)),'/');
74717471
$regex = '/^' . str_replace('\*', '.*', $hostname) . '$/';
74727472
if (preg_match($regex, $origin)) {
74737473
$found = true;

src/Tqdev/PhpCrudApi/Middleware/CorsMiddleware.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private function isOriginAllowed(string $origin, string $allowedOrigins): bool
2626
{
2727
$found = false;
2828
foreach (explode(',', $allowedOrigins) as $allowedOrigin) {
29-
$hostname = preg_quote(strtolower(trim($allowedOrigin)));
29+
$hostname = preg_quote(strtolower(trim($allowedOrigin)),'/');
3030
$regex = '/^' . str_replace('\*', '.*', $hostname) . '$/';
3131
if (preg_match($regex, $origin)) {
3232
$found = true;

0 commit comments

Comments
 (0)