Invalid XML with PHP anonymous class
See original GitHub issueHello 👋
I would like to know if there’s an update regarding the pre-parsing sanitization @joonty ?
I’ve run into an issue similar to #60 today, the parsed xml is:
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="17" context="0">
<property name="$deferred" fullname="$deferred" type="object" classname="Amp\Deferred" children="1" numchildren="2" page="0" pagesize="32">
<property name="resolver" fullname="$deferred->resolver" facet="private" type="object" classname="class@anonymous�/app/vendor/amphp/amp/lib/Deferred.php0x7fa0c40e72d3" children="1" numchildren="4">
</property>
<property name="promise" fullname="$deferred->promise" facet="private" type="object" classname="Amp\Internal\PrivatePromise" children="1" numchildren="1">
</property>
</property>
</response>
which is invalid (because of “invalid character number” �).
The full vdebug error trace is:
- [ERROR] {Tue 17 2018 13:05:36} An error occured: <class 'xml.etree.ElementTree.ParseError'>
Traceback (most recent call last):
File "/home/gildas/.vim/plugged/vdebug/pythonx/vdebug/event.py", line 524, in dispatch_event
Dispatcher.events[name](self.__session_handler).run(*args)
File "/home/gildas/.vim/plugged/vdebug/pythonx/vdebug/event.py", line 439, in run
self.ui.windows.watch().accept_renderer(rend)
File "/home/gildas/.vim/plugged/vdebug/pythonx/vdebug/ui/vimui.py", line 513, in accept_renderer
self.write(renderer.render())
File "/home/gildas/.vim/plugged/vdebug/pythonx/vdebug/ui/vimui.py", line 736, in render
properties = self.response.get_context()
File "/home/gildas/.vim/plugged/vdebug/pythonx/vdebug/dbgp.py", line 132, in get_context
for c in list(self.as_xml()):
File "<string>", line None
xml.etree.ElementTree.ParseError: reference to invalid character number: line 2, column 397
And here’s the PHP version I’m using:
PHP 7.2.3 (cli) (built: Mar 5 2018 21:28:31) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
I’m using version 2.0.0 of Vdebug.
Sorry if this has been issued before, I haven’t found any reference to it.
Thanks in advance.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Anonymous classes - Manual
Anonymous classes ¶ Anonymous classes are useful when simple, one-off objects need to be created. All objects created by the same anonymous class...
Read more >PHP - Processing Invalid XML
This creates and issue because SimpleXML with php just fails, and I don't really know of any good way to handle parsing invalid...
Read more >namespace prefix xsi for type on XXX is not defined
On aug.4.2011 I'v updated my working copy of PHP-client lib from the svn-repository http://google-api-adwords-php.googlecode.com/svn/trunk/.
Read more >Documentation: 9.1: XML Functions
The function xmlcomment creates an XML value containing an XML comment with the specified text as content. The text cannot contain "--" or...
Read more >How to Create Service Aliases and Mark Services as Private
The following example shows how to inject an anonymous service into another service: YAML; XML; PHP. Copy. 1 2 3 4 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Just had this problem, and fixed with the config proposed by @gquemener. Making this as the default should be the way to go imo.
I would suggest to make that a default setting, if vdebug supports it, that is.