Skip to content

Commit

Permalink
Fix php notice
Browse files Browse the repository at this point in the history
preg_replace(): Passing null to parameter #3 () of type array|string is deprecated
  • Loading branch information
colemanw committed Nov 15, 2022
1 parent f925535 commit e218787
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/afform/core/Civi/Afform/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class Tokens {
*/
public static function applyCkeditorWorkaround(GenericHookEvent $e) {
foreach (array_keys($e->content) as $field) {
$e->content[$field] = preg_replace(';https?://(\{afform.*Url\});', '$1', $e->content[$field]);
if (is_string($e->content[$field])) {
$e->content[$field] = preg_replace(';https?://(\{afform.*Url\});', '$1', $e->content[$field]);
}
}
}

Expand Down

0 comments on commit e218787

Please sign in to comment.