Update functions.php for PHP 8

This commit is contained in:
buckaroo-labs 2023-12-20 18:08:41 -08:00 committed by GitHub
parent 6e5f4f3757
commit ef7991221b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,7 +167,8 @@ function createVoteURL($for, $bId)
function shortenString($string, $maxSize=75) { function shortenString($string, $maxSize=75) {
$output = ''; $output = '';
if(strlen($string) > $maxSize) { if(strlen($string) > $maxSize) {
$output = substr($string, 0, $maxSize/2).'...'.substr($string, -$maxSize/2); //2023-12-20 add ROUND() function to avoid 'Deprecated' warning
$output = substr($string, 0, $maxSize/2).'...'.substr($string, -round($maxSize/2));
} else { } else {
$output = $string; $output = $string;
} }