We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 版本:7.0.3 overtrue/wechat 版本:3.0
微信推送的消息里经常会有空标签,如通常的关注/取关事件里,EventKey都是空的,xml内容都是<EventKey><![CDATA[]]></EventKey>,在simplexml_load_string时,这个节点会被解析成SimpleXMLElement对象,而不是字符串,因此会在随后的arrarval方法中被转成空数组。 因此我在使用中就不得不判断每个字段是否为空数组,是的话转为空字符串,否则写入数据库时参数绑定就会出错。 不知道作者是否注意到这个问题?
<EventKey><![CDATA[]]></EventKey>
simplexml_load_string
SimpleXMLElement
arrarval
The text was updated successfully, but these errors were encountered:
XML empty node bugfix #426.
12fd7af
Develop (#429)
ab27301
* XML empty node bugfix #426. * Applied fixes from StyleCI (#427) * Auto validate. * Fix server test. * Applied fixes from StyleCI (#428)
Develop (#437)
fd85b55
* XML empty node bugfix #426. * Applied fixes from StyleCI (#427) * Auto validate. * Fix server test. * Applied fixes from StyleCI (#428) * Fix tests #430 * Add comment. * Applied fixes from StyleCI (#434) * Add getMessage() to server guard.
No branches or pull requests
我用的环境
PHP 版本:7.0.3
overtrue/wechat 版本:3.0
问题及现象
微信推送的消息里经常会有空标签,如通常的关注/取关事件里,EventKey都是空的,xml内容都是
<EventKey><![CDATA[]]></EventKey>
,在simplexml_load_string
时,这个节点会被解析成SimpleXMLElement
对象,而不是字符串,因此会在随后的arrarval
方法中被转成空数组。因此我在使用中就不得不判断每个字段是否为空数组,是的话转为空字符串,否则写入数据库时参数绑定就会出错。
不知道作者是否注意到这个问题?
The text was updated successfully, but these errors were encountered: