- bc4ec38e committed on 8.x-1.x
'Issue #3305744 by ORION web: Deprecated function: strip_tags(): Passing...
- bc4ec38e committed on 8.x-1.x
Automatically closed - issue fixed for 2 weeks with no activity.
While testing on a client site, I realised that it's now possible for empty text fields to trigger the following: Deprecated function: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\node_read_time\Calculate\ReadingTime->calculateReadingTime() (line 186 of /var/www/html/docroot/modules/contrib/node_read_time/src/Calculate/ReadingTime.php)
PHP 8.1, Drupal 9.4.5, node_read_time 8.x-1.6
A new / existing node is being saved with an optional text field, where node read time is implemented, empty.
strip_tags() doesn't like NULL anymore and that's finding its way here:
$words_count = count(preg_split('/\s+/', (strip_tags($this->words))));
A simple solution is to cast to string (though CS will say it's not necessary as $this->words is not supposed to be nullable).
Fixed
1.6
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
'Issue #3305744 by ORION web: Deprecated function: strip_tags(): Passing...
Automatically closed - issue fixed for 2 weeks with no activity.