PHP Warning: max() in sorting.php
-
The following warning is being thrown if $order returns the empty array:
PHP Warning: max(): Array must contain at least one element in /var/www/html/wp-content/plugins/relevanssi/lib/sorting.php on line 314
Suggestion to resolve would be to set $max_key to zero before line 314 and then only use max($order) if $order is not empty.
$max_key = 0;
// Set the default values so that if the key is not found in the array, it’s last.
if (! empty($order)) $max_key = max( $order );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘PHP Warning: max() in sorting.php’ is closed to new replies.