Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Enhance testing that parameter is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
god107 committed Mar 10, 2014
1 parent 88f17c7 commit 8246507
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Reader/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,11 @@ public static function importRemoteFeed($uri, Http\ClientInterface $client)
*/
public static function importString($string)
{
$string = trim($string);
if (empty($string)) {
throw new Exception\InvalidArgumentException('Empty string supplied as input');
$trimmed = trim($string);
if (!is_string($string) || empty($trimmed)) {
throw new Exception\InvalidArgumentException('Only non empty strings are allowed as input');
}

$libxmlErrflag = libxml_use_internal_errors(true);
$oldValue = libxml_disable_entity_loader(true);
$dom = new DOMDocument;
Expand Down

0 comments on commit 8246507

Please sign in to comment.