如何在 NuSOAP 中传递撇号 (')?

发布于 2024-10-25 22:36:32 字数 520 浏览 5 评论 0原文

我试图将包含撇号字符的参数传递给函数调用,但显然它被删除了。这就是我正在做的:

$input = array(
  'kod_modelu' => "187'",
  'nr_nadwozia' => '00552889'
);

$result = $client->call('certyfikat_gwarancji_dane_pobierz', $input);
var_dump($result);

在输出中我得到:(

'kod_modelu' => string '187' (length=3)
'nr_nadwozia' => string '00552889' (length=8)

我在输出中重复输入,并且撇号被删除)。

我该如何解决这个问题?

编辑:这是重现该问题的代码: Pastebin

I am trying to pass an argument containing apostrophe character to function call but apparently it is being stripped out. Here's what I am doing:

$input = array(
  'kod_modelu' => "187'",
  'nr_nadwozia' => '00552889'
);

$result = $client->call('certyfikat_gwarancji_dane_pobierz', $input);
var_dump($result);

And in output I'm getting:

'kod_modelu' => string '187' (length=3)
'nr_nadwozia' => string '00552889' (length=8)

(I am repeating input in output and apostrophe is being stripped out).

How can I solve this?

EDIT: Here's a code to reproduce the issue:
Pastebin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

酷遇一生 2024-11-01 22:36:32

好的,案件结束。

PHP 5.2.6 是问题(请参阅 bugs.php.net)。升级到最新版本的5.2.x分支解决了该问题。

Ok, case closed.

PHP 5.2.6 is the issue (referring to bugs.php.net). Upgrading to the latest version of 5.2.x branch solves the problem.

徒留西风 2024-11-01 22:36:32

这可能是一个不太可能的事情,但由于 SOAP 是基于 XML 的,因此您的引号必须在某处转换为 XML 实体。
我没有使用 nuSOAP 的经验,但单引号的 XML 实体值是:'

参考PHP函数:htmlspecialchars()

This might be a long shot, but since SOAP is XML based your quotes must be converted to XML entities somewhere.
I have no experience with nuSOAP, but a single quote's XML entity value is: '.

Refer to the PHP function: htmlspecialchars()

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文