Skip to content
Snippets Groups Projects
Commit 329e034e authored by Bharath Kumar Kondeti's avatar Bharath Kumar Kondeti Committed by Mark Casias
Browse files

Issue #3376831 by bharath-kondeti, Igumnov_aleksey, Jay Jangid, akshay.singh,...

Issue #3376831 by bharath-kondeti, Igumnov_aleksey, Jay Jangid, akshay.singh, Anybody: PHP 8.1 Deprecated function: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated in smart_trim_field_formatter_view()
parent d5f10bb7
Branches 7.x-1.x
Tags 7.x-1.7
1 merge request!64Issue#3376831: php8.1 deprecation issues.
......@@ -88,7 +88,7 @@ function smart_trim_field_formatter_view($entity_type, $entity, $field, $instanc
// Only bother with this is we have to.
if ($settings['trim_length'] < str_word_count($output)) {
// Use \s or use PREG_CLASS_UNICODE_WORD_BOUNDARY?
$words = preg_split('/\s/', $output, NULL, PREG_SPLIT_NO_EMPTY);
$words = preg_split('/\s/', $output, -1, PREG_SPLIT_NO_EMPTY);
$output2 = implode(" ", array_slice($words, 0, $settings['trim_length']));
$output2 = _filter_htmlcorrector($output2);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment