Skip to content
Snippets Groups Projects

Issue #3280848: Shortcut sort() call to deprecated function: strnatcasecmp()

Closed Eli requested to merge issue/drupal-3280848:3280848-php81-shortcut-strnatcasecmp into 9.3.x
1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
@@ -183,7 +183,9 @@ public static function sort(ShortcutInterface $a, ShortcutInterface $b) {
$a_weight = $a->getWeight();
$b_weight = $b->getWeight();
if ($a_weight == $b_weight) {
return strnatcasecmp($a->getTitle(), $b->getTitle());
$a_title = $a->getTitle() ?: '';
$b_title = $b->getTitle() ?: '';
return strnatcasecmp($a_title, $b_title);
}
return $a_weight <=> $b_weight;
}
Loading