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

Commit

Permalink
Merge branch 'hotfix/3362'
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/Reader/Entry/Rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public function getAuthors()
}

$authors = array();
$authors_dc = $this->getExtension('DublinCore')->getAuthors();
if (!empty($authors_dc)) {
foreach ($authors_dc as $author) {
$authorsDc = $this->getExtension('DublinCore')->getAuthors();
if (!empty($authorsDc)) {
foreach ($authorsDc as $author) {
$authors[] = array(
'name' => $author['name']
);
Expand Down
6 changes: 3 additions & 3 deletions src/Reader/Feed/Rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ public function getAuthors()
}

$authors = array();
$authors_dc = $this->getExtension('DublinCore')->getAuthors();
if (!empty($authors_dc)) {
foreach ($authors_dc as $author) {
$authorsDc = $this->getExtension('DublinCore')->getAuthors();
if (!empty($authorsDc)) {
foreach ($authorsDc as $author) {
$authors[] = array(
'name' => $author['name']
);
Expand Down
16 changes: 8 additions & 8 deletions src/Reader/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public static function import($uri, $etag = null, $lastModified = null)
*/
public static function importString($string)
{
$libxml_errflag = libxml_use_internal_errors(true);
$libxmlErrflag = libxml_use_internal_errors(true);
$oldValue = libxml_disable_entity_loader(true);
$dom = new DOMDocument;
$status = $dom->loadXML(trim($string));
Expand All @@ -281,7 +281,7 @@ public static function importString($string)
}
}
libxml_disable_entity_loader($oldValue);
libxml_use_internal_errors($libxml_errflag);
libxml_use_internal_errors($libxmlErrflag);

if (!$status) {
// Build error message
Expand Down Expand Up @@ -346,12 +346,12 @@ public static function findFeedLinks($uri)
throw new Exception\RuntimeException("Failed to access $uri, got response code " . $response->getStatusCode());
}
$responseHtml = $response->getBody();
$libxml_errflag = libxml_use_internal_errors(true);
$libxmlErrflag = libxml_use_internal_errors(true);
$oldValue = libxml_disable_entity_loader(true);
$dom = new DOMDocument;
$status = $dom->loadHTML(trim($responseHtml));
libxml_disable_entity_loader($oldValue);
libxml_use_internal_errors($libxml_errflag);
libxml_use_internal_errors($libxmlErrflag);
if (!$status) {
// Build error message
$error = libxml_get_last_error();
Expand Down Expand Up @@ -401,14 +401,14 @@ public static function detectType($feed, $specOnly = false)
ini_restore('track_errors');
ErrorHandler::stop();
if (!$status) {
if (!isset($php_errormsg)) {
if (!isset($phpErrormsg)) {
if (function_exists('xdebug_is_enabled')) {
$php_errormsg = '(error message not available, when XDebug is running)';
$phpErrormsg = '(error message not available, when XDebug is running)';
} else {
$php_errormsg = '(error message not available)';
$phpErrormsg = '(error message not available)';
}
}
throw new Exception\RuntimeException("DOMDocument cannot parse XML: $php_errormsg");
throw new Exception\RuntimeException("DOMDocument cannot parse XML: $phpErrormsg");
}
} else {
throw new Exception\InvalidArgumentException('Invalid object/scalar provided: must'
Expand Down

0 comments on commit 8677f66

Please sign in to comment.