Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add check for empty file to factory build method

  • Loading branch information...
commit a6a76c5fd0fcb2f243d1bad6859025c3f2492207 1 parent 99ccf9a
@meldra meldra authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 XML/Feed/Parser/Factory.php
View
4 XML/Feed/Parser/Factory.php
@@ -42,6 +42,10 @@ function build(DOMDocument $model, $feed, $strict = false, $suppressWarnings = f
$options |= LIBXML_NOERROR;
}
+ if (empty($feed)) {
+ throw new XML_Feed_Parser_Exception('Invalid input: file is empty');
+ }
+
if (! $model->loadXML($feed, $options)) {
if (extension_loaded('tidy') && $tidy) {
$tidy = new tidy;
Please sign in to comment.
Something went wrong with that request. Please try again.