Skip to content

Stdlib: htmlspecialchars ENT_DISALLOWED replaces illegal scalars with U+FFFD (#32084) - #32099

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-32084-htmlspecialchars-ent-disallowed
Aug 18, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-32084-htmlspecialchars-ent-disallowed

Conversation

@PurHur

@PurHur PurHur commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference: php/php-src ext/standard/html.cphp_escape_html_entities_ex / unicode_cp_is_allowed. PHP implementation: ext/standard/VmString.php.

Test plan

  • Issue repro VM vs Zend
  • Issue repro JIT vs Zend
  • Targeted PHPUnit (HtmlspecialcharsEntDisallowed, helper shrink tests, ENT_IGNORE regression)

Verification

./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_htmlspecialchars_ent_disallowed.php'

Zend:

string(6) "efbfbd"
string(6) "efbfbd"
string(18) "61efbfbd62efbfbd63"
string(2) "01"
tab=09
fdd0=efbfbd
xml_del=7f
ZEND_EXIT:0
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_htmlspecialchars_ent_disallowed.php'
string(6) "efbfbd"
string(6) "efbfbd"
string(18) "61efbfbd62efbfbd63"
string(2) "01"
tab=09
fdd0=efbfbd
xml_del=7f
VM_EXIT:0
./script/docker-exec.sh -- bash -lc 'php bin/jit.php test/repro/maintainer_gap_htmlspecialchars_ent_disallowed.php'
string(6) "efbfbd"
string(6) "efbfbd"
string(18) "61efbfbd62efbfbd63"
string(2) "01"
tab=09
fdd0=efbfbd
xml_del=7f
JIT_EXIT:0
./script/phpunit.sh --filter 'HtmlspecialcharsEntDisallowed|HtmlspecialcharsRuntimeShrinkTest|HtmlEntitiesJitRuntimeShrinkTest|HtmlspecialcharsEntIgnore'
OK (13 tests, 63 assertions)

Not covered: full make test-harness, ci-local.sh LLVM, north-star5-verify. check-generated-docs.sh is red on master (capability-matrix/syntax drift) independent of this diff.

Made with Cursor

… U+FFFD (#32084)

php-src html.c unicode_cp_is_allowed maps C0/DEL/HTML5 noncharacters to U+FFFD
when ENT_DISALLOWED is set. Match that in VmString and NestedJIT helpers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 885623c into master Aug 18, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-32084-htmlspecialchars-ent-disallowed branch August 18, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: htmlspecialchars/htmlentities ENT_DISALLOWED leaves C0 controls — Zend replaces with U+FFFD (ext/standard/html.c)

1 participant