comparison core/lib/Drupal/Component/Utility/Unicode.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 7a779792577d
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
546 if ($wordsafe) { 546 if ($wordsafe) {
547 $matches = []; 547 $matches = [];
548 // Find the last word boundary, if there is one within $min_wordsafe_length 548 // Find the last word boundary, if there is one within $min_wordsafe_length
549 // to $max_length characters. preg_match() is always greedy, so it will 549 // to $max_length characters. preg_match() is always greedy, so it will
550 // find the longest string possible. 550 // find the longest string possible.
551 $found = preg_match('/^(.{' . $min_wordsafe_length . ',' . $max_length . '})[' . Unicode::PREG_CLASS_WORD_BOUNDARY . ']/u', $string, $matches); 551 $found = preg_match('/^(.{' . $min_wordsafe_length . ',' . $max_length . '})[' . Unicode::PREG_CLASS_WORD_BOUNDARY . ']/us', $string, $matches);
552 if ($found) { 552 if ($found) {
553 $string = $matches[1]; 553 $string = $matches[1];
554 } 554 }
555 else { 555 else {
556 $string = static::substr($string, 0, $max_length); 556 $string = static::substr($string, 0, $max_length);