Fix passing null deprecation warning on CakeText::insert method

Warning message: `Deprecated (8192): preg_quote(): Passing null to parameter #1 ($str) of type string is deprecated [vendor/cakephp/cakephp/lib/Cake/Utility/CakeText.php, line 168]`
This commit is contained in:
Diego Surita 2023-12-22 10:01:56 -03:00 committed by Kamil Wylegala
parent c646ba319d
commit fa1f817be2

View file

@ -164,8 +164,8 @@ class CakeText {
$format = sprintf( $format = sprintf(
'/(?<!%s)%s%%s%s/', '/(?<!%s)%s%%s%s/',
preg_quote($options['escape'], '/'), preg_quote($options['escape'], '/'),
str_replace('%', '%%', preg_quote($options['before'], '/')), str_replace('%', '%%', preg_quote((string)$options['before'], '/')),
str_replace('%', '%%', preg_quote($options['after'], '/')) str_replace('%', '%%', preg_quote((string)$options['after'], '/'))
); );
} }