Skip to content

Commit

Permalink
Ensure "this should never happen" doesn't
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccue authored and skyzyx committed Nov 28, 2012
1 parent 0d876f3 commit 438acfe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/SimplePie/IRI.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ protected function parse_iri($iri)
}
else
{
trigger_error('This should never happen', E_USER_ERROR);
die;
// This can occur when a paragraph is accidentally parsed as a URI
return false;
}
}

Expand Down Expand Up @@ -824,6 +824,10 @@ public function set_iri($iri)
else
{
$parsed = $this->parse_iri((string) $iri);
if (!$parsed)
{
return false;
}

$return = $this->set_scheme($parsed['scheme'])
&& $this->set_authority($parsed['authority'])
Expand Down

0 comments on commit 438acfe

Please sign in to comment.