aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-05-09 12:57:11 +0200
committerGravatar GitHub <noreply@github.com> 2022-05-09 12:57:11 +0200
commit893d4d14c06fcb72835f8e152cd6f22f3209263e (patch)
treef6f92bcb07e4be5d046d5fb6d54916fe74bf9286 /lib
parent05d263d67c97c9e06c2e5b60402210d96324f991 (diff)
OPML relax error check for non-strict mode (#4343)
#fix https://github.com/FreshRSS/FreshRSS/issues/3967
Diffstat (limited to 'lib')
-rw-r--r--lib/lib_opml.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/lib_opml.php b/lib/lib_opml.php
index 5c111641b..b62f988c4 100644
--- a/lib/lib_opml.php
+++ b/lib/lib_opml.php
@@ -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'
);
}
}