Skip to content

Commit

Permalink
Fix passing null deprecation warning on CakeText::insert method
Browse files Browse the repository at this point in the history
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]`
  • Loading branch information
diegosurita committed Dec 22, 2023
1 parent c646ba3 commit f4f6675
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Utility/CakeText.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ public static function insert($str, $data, $options = array()) {
$format = sprintf(
'/(?<!%s)%s%%s%s/',
preg_quote($options['escape'], '/'),
str_replace('%', '%%', preg_quote($options['before'], '/')),
str_replace('%', '%%', preg_quote($options['after'], '/'))
str_replace('%', '%%', preg_quote((string)$options['before'], '/')),
str_replace('%', '%%', preg_quote((string)$options['after'], '/'))
);
}

Expand Down

0 comments on commit f4f6675

Please sign in to comment.