No Code Attached Yet PHP 8.x
avatar brianteeman
brianteeman
12 Jul 2022

php 8.2 will shortly be entering beta phase. Although there are not as many deprecations as in 8.1 we were very much behind the curve with 8.1 and we should be more proactive and look at this deprecations now.

Deprecate and Remove utf8_encode and utf8_decode

More information in the RFC

if (
preg_match('#[<>"\'%;()&\\\\]|\\.\\./#', $value) || strlen(utf8_decode($value)) < 2
|| $filterInput->clean($value, 'TRIM') !== $value
|| strlen(utf8_decode($value)) > $element['size']

if ($username) {
$isUsernameCompliant = !(preg_match('#[<>"\'%;()&\\\\]|\\.\\./#', $username) || strlen(utf8_decode($username)) < 2
|| trim($username) !== $username);

protected function decode($source)
{
static $ttr;
if (!\is_array($ttr)) {
// Entity decode
$trans_tbl = get_html_translation_table(HTML_ENTITIES, ENT_COMPAT, 'ISO-8859-1');
foreach ($trans_tbl as $k => $v) {
$ttr[$v] = utf8_encode($k);
}
}
$source = strtr($source, $ttr);
// Convert decimal
$source = preg_replace_callback(
'/&#(\d+);/m',
function ($m) {
return utf8_encode(\chr($m[1]));
},
$source
);
// Convert hex
$source = preg_replace_callback(
'/&#x([a-f0-9]+);/mi',
function ($m) {
return utf8_encode(\chr('0x' . $m[1]));
},
$source

avatar brianteeman brianteeman - open - 12 Jul 2022
avatar joomla-cms-bot joomla-cms-bot - change - 12 Jul 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Jul 2022
avatar chmst chmst - change - 12 Jul 2022
Labels Added: PHP 8.x
avatar chmst chmst - labeled - 12 Jul 2022
avatar brianteeman brianteeman - change - 9 Jan 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-01-09 09:33:08
Closed_By brianteeman
avatar brianteeman brianteeman - close - 9 Jan 2023
avatar brianteeman
brianteeman - comment - 9 Jan 2023

Closed see #39583

Add a Comment

Login with GitHub to post a comment