Skip to content

Conversation

Copy link

Copilot AI commented Dec 14, 2025

The $charencoding property was hardcoded to true with no public API to change it, preventing users from disabling automatic XML entity encoding when needed.

Changes

  • nusoap_base: Added getCharencoding() and setCharencoding($charencoding) public methods
  • nusoap_client: Propagate charencoding setting to wsdl objects in constructor and loadWSDL()
  • Tests: Added coverage for getter/setter and verification that expandEntities() respects the setting

Usage

$client = new nusoap_client('http://example.com/soap');
$client->setCharencoding(false);  // Disable XML entity encoding

// With charencoding=false, special characters pass through unchanged
$client->expandEntities('<test> & "value"');  // Returns: <test> & "value"

// With charencoding=true (default), entities are encoded
$client->setCharencoding(true);
$client->expandEntities('<test> & "value"');  // Returns: &lt;test&gt; &amp; &quot;value&quot;

Default remains true for backward compatibility.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/contributte/tester/zipball/d7db5a9b2b76910805ce191fa96b59d51c3b4dc1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/NRGz9i /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/nette/tester/zipball/dc02e7811f3491a72e87538044586cee2f483d58
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/JBUaAf /usr/bin/composer install (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/NRGz9i /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/474f18bc6cc6aca61ca40bfab55139de614e51ca
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/JBUaAf /usr/bin/composer install (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/NRGz9i /usr/bin/composer install --no-interaction (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Charencoding always true</issue_title>
<issue_description>The variable $charencoding is always true. I saw that is a private declaration. I need $charencoding to be false for my string parameters.
On my project I modified the nusoap_base (I added setCharencoding and getCharencoding), nusoap_client (construct and loadWsdl to setCharencoding to nusoap client object and to $this->wsdl object) .</issue_description>

<agent_instructions>Try to resolve it</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix charencoding variable to allow false values Add configurable charencoding property with getter/setter methods Dec 14, 2025
Copilot AI requested a review from f3l1x December 14, 2025 09:27
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.

Charencoding always true

2 participants