Permalink
Browse files

Add check for empty file to factory build method

  • Loading branch information...
1 parent 99ccf9a commit a6a76c5fd0fcb2f243d1bad6859025c3f2492207 @meldra meldra committed Dec 20, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 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;

0 comments on commit a6a76c5

Please sign in to comment.