Stop assuming encoding of xml, let simplexml throw silently (#457)
This commit is contained in:
parent
730ce50b44
commit
62bd42cb17
|
@ -9,21 +9,21 @@
|
|||
* [Daniel Schaal](mailto:daniel@schaal.email)
|
||||
* [Davide Saurino](mailto:davide.saurino@alcacoop.it)
|
||||
* [raghunayyar](mailto:me@iraghu.com)
|
||||
* [Benjamin Brahmer](mailto:info@b-brahmer.de)
|
||||
* [bastei](mailto:bastei@users.noreply.github.com)
|
||||
* [Bernhard Posselt](mailto:bep@foryouandyourcustomers.com)
|
||||
* [Sean Molenaar](mailto:sean@seanmolenaar.eu)
|
||||
* [Thomas Müller](mailto:thomas.mueller@tmit.eu)
|
||||
* [Benjamin Brahmer](mailto:info@b-brahmer.de)
|
||||
* [Hoàng Đức Hiếu](mailto:hdhoang@zahe.me)
|
||||
* [Daniel Opitz](mailto:git@copynpaste.de)
|
||||
* [rakekniven](mailto:mark.ziegler@rakekniven.de)
|
||||
* [David-Development](mailto:david-dev@live.de)
|
||||
* [IBBoard](mailto:dev@ibboard.co.uk)
|
||||
* [Koen Martens](mailto:gmc@sonologic.nl)
|
||||
* [Lukas Reschke](mailto:lukas@owncloud.com)
|
||||
* [Sean Molenaar](mailto:sean@m2mobi.com)
|
||||
* [Bart Visscher](mailto:bartv@thisnet.nl)
|
||||
* [Christian Elmer](mailto:christian@keinkurt.de)
|
||||
* [IBBoard](mailto:dev@ibboard.co.uk)
|
||||
* [Thomas Tanghus](mailto:thomas@tanghus.net)
|
||||
* [Volkan Gezer](mailto:volkangezer@gmail.com)
|
||||
* [Xéfir Destiny](mailto:xefir@crystalyx.net)
|
||||
|
@ -73,6 +73,7 @@
|
|||
* [Frank Karlitschek](mailto:frank@owncloud.org)
|
||||
* [Hanzei](mailto:Hanzei@users.noreply.github.com)
|
||||
* [Hendrik Leppelsack](mailto:hendrik@leppelsack.de)
|
||||
* [Jasper Knockaert](mailto:jasper@knockaert.nl)
|
||||
* [Matthias Blümel](mailto:user@inanna.local)
|
||||
* [Michael Grosser](mailto:github@stp-ip.net)
|
||||
* [Michael Holley](mailto:michaelwholley@gmail.com)
|
||||
|
|
|
@ -41,9 +41,10 @@
|
|||
"riimu/kit-pathjoin": "1.2.0",
|
||||
"debril/feed-io": "^3.1",
|
||||
"arthurhoaro/favicon": "^1.2",
|
||||
"ext-json": "*",
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"ext-simplexml": "*"
|
||||
"ext-json": "*",
|
||||
"ext-simplexml": "*",
|
||||
"ext-libxml": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^6.5",
|
||||
|
|
|
@ -503,6 +503,7 @@ class Item extends Entity implements IAPI, \JsonSerializable
|
|||
{
|
||||
return (
|
||||
stripos($mime, 'audio/') !== false ||
|
||||
stripos($mime, 'image/') !== false ||
|
||||
stripos($mime, 'video/') !== false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,11 +208,13 @@ class FeedFetcher implements IFeedFetcher
|
|||
'HTML-ENTITIES',
|
||||
mb_detect_encoding($body)
|
||||
);
|
||||
libxml_use_internal_errors(true);
|
||||
$data = simplexml_load_string(
|
||||
'<?xml version="1.0" encoding="utf-8"?><item>' . $body . '</item>',
|
||||
"<?xml version=\"1.0\"?><item>$body</item>",
|
||||
SimpleXMLElement::class,
|
||||
LIBXML_NOCDATA
|
||||
);
|
||||
libxml_clear_errors();
|
||||
$body = ($data === false) ? $body : (string) $data;
|
||||
$item->setBody($body);
|
||||
|
||||
|
|
Loading…
Reference in New Issue