mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-20 18:24:36 -04:00
OPML relax error check for non-strict mode (#4343)
#fix https://github.com/FreshRSS/FreshRSS/issues/3967
This commit is contained in:
1 parent
05d263d67c
commit
893d4d14c0
1 file changed
+3
-3
+3
-3
@@ -150,7 +150,7 @@ function preprocessing_categories($doc) {
|
||||
* Parse a string as a XML one and returns the corresponding array
|
||||
*
|
||||
* @param string $xml is the string we want to parse
|
||||
* @param bool $strict true if "text" attribute is required, false else
|
||||
* @param bool $strict true to perform some validation (e.g. require "text" attribute), false to relax
|
||||
* @return array corresponding to the XML string and following format described above
|
||||
* @throws LibOPML_Exception
|
||||
* @access public
|
||||
@@ -182,9 +182,9 @@ function libopml_parse_string($xml, $strict = true) {
|
||||
foreach ($opml->head->children() as $key => $value) {
|
||||
if (in_array($key, unserialize(HEAD_ELEMENTS), true)) {
|
||||
$array['head'][$key] = (string)$value;
|
||||
} else {
|
||||
} elseif ($strict) {
|
||||
throw new LibOPML_Exception(
|
||||
$key . 'is not part of OPML format'
|
||||
$key . ' is not part of the OPML 2.0 specification'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user