Skip to content

Invalid XML with PHP anonymous class  #369

@gquemener

Description

@gquemener

Hello 👋

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-&gt;resolver" facet="private" type="object" classname="class@anonymous&#0;/app/vendor/amphp/amp/lib/Deferred.php0x7fa0c40e72d3" children="1" numchildren="4">
        </property>
        <property name="promise" fullname="$deferred-&gt;promise" facet="private" type="object" classname="Amp\Internal\PrivatePromise" children="1" numchildren="1">
        </property>
    </property>
</response>

which is invalid (because of "invalid character number" &#0;).

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions