Skip to content

Stdlib: DOMXPath::quote() — PHP 8.4 XPath literal escaping (#18650)#18651

Merged
PurHur merged 2 commits into
masterfrom
agent/issue-18650-dom-xpath-quote
Jul 13, 2026
Merged

Stdlib: DOMXPath::quote() — PHP 8.4 XPath literal escaping (#18650)#18651
PurHur merged 2 commits into
masterfrom
agent/issue-18650-dom-xpath-quote

Conversation

@PurHur

@PurHur PurHur commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • ext/dom/xpath.cPHP_METHOD(DOMXPath, quote)

PHP implementation

  • ext/dom/XPathQuote.php — static VM handler
  • ext/dom/VmDomXPath.php — quoting core
  • ext/dom/VmDom.php — registration gate
  • lib/CompilerVersion.phpsupportsDomXPathQuote()

Closes #18650

Verification

php bin/vm.php test/repro/maintainer_gap_dom_xpath_quote.php
# ok

./script/phpunit.sh --filter 'DomModuleTest::test_dom_xpath_quote|dom_xpath_quote'
# OK (3 tests, 3 assertions)

PHP_COMPILER_PROFILE=8.2 php bin/vm.php -r 'echo (int)method_exists("DOMXPath","quote"),"\n";'
# 0

php script/bootstrap-inventory.php --check
# OK 4776/4776

Test plan

  • Issue repro green on VM
  • Compliance test/compliance/cases/dom/dom_xpath_quote.phpt
  • 8.2 profile phantom gate (method_exists false)
  • Bootstrap inventory check

Made with Cursor

PurHur and others added 2 commits July 13, 2026 17:16
Adds the static escaper from php-src ext/dom/xpath.c behind the 8.4 profile gate so XPath queries can safely embed quoted attribute values without new C runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
Regenerate bootstrap-inventory.md after conflict resolution.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit c738270 into master Jul 13, 2026
@PurHur PurHur deleted the agent/issue-18650-dom-xpath-quote branch July 13, 2026 17:17
PurHur added a commit that referenced this pull request Jul 13, 2026
)

* Bootstrap: resync inventory after NamedArgs variadic fix (#18653)

Regenerate docs/bootstrap-inventory.md so bootstrap-inventory --check
matches lib/JIT/NamedArgs.php and related vm.php-path drift from #18653.

Refs #1492

Co-authored-by: Cursor <cursoragent@cursor.com>

* Bootstrap: extend lib spine for DOM XPathQuote + session handlers

Append four vm.php-path inventory files missing from
compiler_lib_spine_smoke so check-selfhost-spine-coverage-sync passes
after #18650/#18651 extension additions.

Refs #1492

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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: DOMXPath::quote() missing — PHP 8.4 XPath string escaping (ext/dom/xpath.c)

1 participant