Skip to content

Commit

Permalink
bugfix when loading incorrectly formatted XML
Browse files Browse the repository at this point in the history
Exception was trying to use a LibXMLError object as a string. "message"
property now used instead.
  • Loading branch information
skwi committed Aug 28, 2012
1 parent 4a4536f commit ee0ba48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Translation/Loader/XliffLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ public function load($resource, $locale, $domain = 'messages')
$previous = libxml_use_internal_errors(true);
if (false === $doc = simplexml_load_file($resource)) {
libxml_use_internal_errors($previous);
$libxmlError = libxml_get_last_error();

throw new RuntimeException(sprintf('Could not load XML-file "%s": %s', $resource, libxml_get_last_error()));
throw new RuntimeException(sprintf('Could not load XML-file "%s": %s', $resource, $libxmlError->message));
}
libxml_use_internal_errors($previous);

Expand Down

0 comments on commit ee0ba48

Please sign in to comment.