Put regex rules between single quotes

This commit is contained in:
jo 2021-10-12 11:09:46 +02:00
parent d52c6184b9
commit f05c228f1d
7 changed files with 16 additions and 16 deletions

View file

@ -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.

View file

@ -69,7 +69,7 @@ class Application_Common_Database
$new_params[$k] = $new_params[$v];
} else {
foreach (range(1, $matches_count) as $i) {
preg_replace("/{$k}(\D)/", "{$k}{$i}${1}", $sql, 1);
preg_replace('/' . $k . '(\D)/', "{$k}{$i}${1}", $sql, 1);
$new_params[$k . $i] = $v;
}
}