Skip to content

Stdlib: html_entity_decode() combined ENT_* flags — LogicException not decoded output (ext/standard/html.c) #10519

Description

@PurHur

Summary

html_entity_decode() with combined integer flags (e.g. ENT_QUOTES | ENT_HTML5) should decode entities. This compiler throws LogicException: html_entity_decode() flags must be an integer.

Related: #9586 tracks similar ENT_* constant rejection on htmlspecialchars() — this is the html_entity_decode() decode path.

php-src reference

  • ext/standard/html.c — php_html_entities() / decode with ENT_HTML5 etc.

Repro

<?php
declare(strict_types=1);
var_dump(html_entity_decode('&amp;', ENT_QUOTES | ENT_HTML5));

Zend: string(1) "&"

VM: LogicException: html_entity_decode() flags must be an integer in this compiler build

Expected (php-src-strict)

Accept integer bitmask flags; return decoded string like Zend.

Implementation hints

Done when

  • Repro green on VM
  • Guard for ENT_QUOTES | ENT_HTML5 (and named flags: arg if applicable)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions