Hi I am planning upgrades to a number of freepbx servers. Note, I’m using RHEL 7 not sng linux and i’m in a “corporate enviroment” which means i have lots of rules from different IT departments. So sometimes which is very logical is not available to me.
so with the latest modules (Freebox Recording module 15.0.3.19) I’m getting the message below after upgrading php 5.6 to php 7.4.
I appears there is a issue in that code with braces. Is there an easy patch? (even if it sets off the tamper module to let me sperae the changes into smaller bits or do I have to do a 16 install at the same time?
/var/www/html/admin/libraries/Composer/vendor/neitanod/forceutf8/src/ForceUTF8/Encoding.php
*/
if(is_array($text))
{
foreach($text as $k => $v)
{
$text[$k] = self::toUTF8($v);
}
return $text;
}
if(!is_string($text)) {
return $text;
}
$max = self::strlen($text);
$buf = "";
for($i = 0; $i < $max; $i++){
$c1 = $text{$i};
if($c1>="\xc0"){ //Should be converted to UTF8, if it's not UTF8 already
$c2 = $i+1 >= $max? "\x00" : $text{$i+1};
$c3 = $i+2 >= $max? "\x00" : $text{$i+2};
$c4 = $i+3 >= $max? "\x00" : $text{$i+3};
if($c1 >= "\xc0" & $c1 <= "\xdf"){ //looks like 2 bytes UTF8
if($c2 >= "\x80" && $c2 <= "\xbf"){ //yeah, almost sure it's UTF8 already
$buf .= $c1 . $c2;
$i++;
} else { //not valid UTF8. Convert it.
$cc1 = (chr(ord($c1) / 64) | "\xc0");
$cc2 = ($c1 & "\x3f") | "\x80";
$buf .= $cc1 . $cc2;
}
} elseif($c1 >= "\xe0" & $c1 <= "\xef"){ //looks like 3 bytes UTF8
if($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf"){ //yeah, almost sure it's UTF8 already
$buf .= $c1 . $c2 . $c3;
$i = $i + 2;
} else { //not valid UTF8. Convert it.
$cc1 = (chr(ord($c1) / 64) | "\xc0");
$cc2 = ($c1 & "\x3f") | "\x80";
Arguments
“Array and string offset access syntax with curly braces is deprecated”