|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76719 PECL REST channel returns invalid XML
Submitted: 2018-08-08 02:24 UTC Modified: 2018-08-08 17:35 UTC
From: dzuelke at gmail dot com Assigned:
Status: Open Package: PECL website (PECL)
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-08-08 02:24 UTC] dzuelke at gmail dot com
Same again as #58446, #59098, #59666...

Several endpoints in the API return invalid XML, the issue is always the same: weird XML prolog and extra elements in the middle of the document; sometimes just one more time, sometimes more, e.g. one in Authentication, three in Caching:

 <ca xlink:href="/rest/c/Authentication">Authentication</ca>
 <s>PAM integration</s>
 <d>This extension provides PAM (Pluggable Authentication Modules) integration. PAM is a system of libraries that handle the authentication tasks of applications and services. The library provides a stable API for applications to defer to for authentication tasks.</d>
 <r xlink:href="/rest/r/pam"/>
</p><?xml version="1.0" encoding="UTF-8" ?>
<a xmlns=""
    xmlns:xsi="" xmlns:xlink=""     xsi:schemaLocation="">

The test script below outputs the number of XML prologs for each category that has more than one in the XML.

Test script:
for f in $(curl | grep -o 'c xlink:href="[^"]*' | cut -d'"' -f2 | sed 's/info.xml/packagesinfo.xml/' | sed s#^#; do { echo -n "$f: "; curl --silent $f | grep '<?xml' | wc -l; } | grep -v 1; done

Actual result:
--------------        2        4        2        2        2        3        3        2        2        2        2        2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-08 17:35 UTC]
It seems to me that this code[1] didn't work as hoped.

[1] <>
 [2018-08-08 21:22 UTC] dzuelke at gmail dot com
Ugh, XML assembled via string concatenation? No wonder this is buggy.
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 07:01:26 2019 UTC