mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixed deprecation notice about 'preg_match(): Passing null to parameter #2 () of type string is deprecated'
This commit is contained in:
parent
ef0e0a7175
commit
08f228f02a
1 changed files with 2 additions and 1 deletions
|
@ -470,7 +470,8 @@ class CakeRoute {
|
|||
//check patterns for routed params
|
||||
if (!empty($this->options)) {
|
||||
foreach ($this->options as $key => $pattern) {
|
||||
if (array_key_exists($key, $url) && !preg_match('#^' . $pattern . '$#', $url[$key])) {
|
||||
//Fixing deprecation notice about null $subject in PHP8.1.
|
||||
if (array_key_exists($key, $url) && !preg_match('#^' . $pattern . '$#', $url[$key] ?? "")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue