]> git.wh0rd.org Git - tt-rss.git/commitdiff
Feedparser: Only format fatal errors
authorwltb <wltb@localhost.com>
Tue, 24 Sep 2013 14:43:47 +0000 (16:43 +0200)
committerwltb <wltb@localhost.com>
Tue, 24 Sep 2013 14:43:47 +0000 (16:43 +0200)
classes/feedparser.php

index 22052bdb6c8352b5981f5d3ba08918cebf1144fc..07de73a9d5927d338adc7d03754a044470ce60fb 100644 (file)
@@ -62,8 +62,16 @@ class FeedParser {
                                }
                        }
                }
-
-               $this->error = $this->format_error($error);
+               
+               $this->error = "";
+               if($error) {
+                       foreach(libxml_get_errors() as $error) {
+                               if($error->level == LIBXML_ERR_FATAL) {
+                                       $this->error = $this->format_error($error);
+                                       break; //break here because currently we only show one error
+                               }
+                       }       
+               }
                libxml_clear_errors();
 
                $this->items = array();