Skip to content

Stdlib: SoapVar XSD_ANYXML escapes and wraps param — Zend embeds raw XML (ext/soap/php_encoding.c) #32241

Description

@PurHur

Category

stdlib · php-src-strict · child of #3724 · SOAP encoding batch (XSD_ANYXML)

Problem

php-src to_xml_any() inserts the payload as an xmlStringTextNoenc node (no xsi:type, no extra element wrapper). A string '<raw>x</raw>' becomes a child of the operation element. VM htmlspecialchars-escapes the string and wraps it in <param0>.

Repro (2026-08-18, php8.2-soap, SOAP_ENCODED RPC) Zend VM
new SoapVar('<raw>x</raw>', XSD_ANYXML) <ns1:echo><raw>x</raw></ns1:echo> <ns1:echo><param0>&lt;raw&gt;x&lt;/raw&gt;</param0></ns1:echo>
new SoapVar('plain', XSD_ANYXML) plain (no wrapper, no xsi:type) <param0>plain</param0>

php-src reference

PHP implementation target

  • ext/soap/VmSoapClient.phpencodeSoapVar() XSD_ANYXML path: unescaped fragment, no param wrapper / xsi:type
  • Repro + compliance under test/compliance/cases/stdlib/

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro/issue_soapvar_xsd_anyxml.php'

Done when

  • '<raw>x</raw>' embeds as raw XML under the operation element (VM)
  • Plain text ANYXML is unwrapped and untyped
  • Compliance .phpt guard
  • php-src-strict

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 machinebugSomething isn't workingimplementation-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