Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider new HTML entity en/decode function defaults since PHP 8.1 #9471

Merged
merged 3 commits into from Mar 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -10,6 +10,7 @@

use function count;
use function strtolower;
use function version_compare;

use const ENT_QUOTES;

Expand Down Expand Up @@ -46,6 +47,10 @@ public static function addTaints(AddRemoveTaintsEvent $event): array
$second_arg = $item->getArgs()[1]->value ?? null;

if ($second_arg === null) {
$php_version = $statements_analyzer->getCodebase()->config->getPhpVersion();
pereorga marked this conversation as resolved.
Show resolved Hide resolved
if ($php_version !== null && version_compare($php_version, '8.1', '>=')) {
return ['html', 'has_quotes'];
}
return ['html'];
}

Expand Down Expand Up @@ -95,6 +100,10 @@ public static function removeTaints(AddRemoveTaintsEvent $event): array
$second_arg = $item->getArgs()[1]->value ?? null;

if ($second_arg === null) {
$php_version = $statements_analyzer->getCodebase()->config->getPhpVersion();
if ($php_version !== null && version_compare($php_version, '8.1', '>=')) {
return ['html', 'has_quotes'];
}
return ['html'];
}

Expand Down