Put regex rules between single quotes
This commit is contained in:
parent
d52c6184b9
commit
f05c228f1d
7 changed files with 16 additions and 16 deletions
|
@ -8,7 +8,7 @@ class CORSHelper
|
|||
$origin = $request->getHeader('Origin');
|
||||
$allowedOrigins = self::getAllowedOrigins($request);
|
||||
|
||||
if ((!(preg_match("/https?:\/\/localhost/", $origin) === 1)) && ($origin != '')
|
||||
if ((!(preg_match('/https?:\/\/localhost/', $origin) === 1)) && ($origin != '')
|
||||
&& (!in_array($origin, $allowedOrigins))
|
||||
) {
|
||||
//Don't allow CORS from other domains to prevent XSS.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue