diff options
author | Andrew Dolgov <[email protected]> | 2013-09-25 14:26:45 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-09-25 14:26:45 +0400 |
commit | 4d49863f65e14190c8e460700f2bd197e724666c (patch) | |
tree | 6398c232006fe932ba3bb4045a24162b53df6b78 | |
parent | f227d0af28e2734587fccb0b5fc5dfa7fe639593 (diff) |
fix style in feedparser
-rw-r--r-- | classes/feedparser.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/classes/feedparser.php b/classes/feedparser.php index 07de73a9d..2942fb27d 100644 --- a/classes/feedparser.php +++ b/classes/feedparser.php @@ -42,11 +42,11 @@ class FeedParser { // some terrible invalid unicode entity? if ($error) { - foreach(libxml_get_errors() as $err) { + foreach (libxml_get_errors() as $err) { if ($err->code == 9) { // remove dangling bytes $data = mb_convert_encoding($data, 'UTF-8', 'UTF-8'); - + // apparently not all UTF-8 characters are valid for XML $data = preg_replace('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $data); @@ -62,15 +62,15 @@ class FeedParser { } } } - + $this->error = ""; - if($error) { - foreach(libxml_get_errors() as $error) { - if($error->level == LIBXML_ERR_FATAL) { + if ($error) { + foreach (libxml_get_errors() as $error) { + if ($error->level == LIBXML_ERR_FATAL) { $this->error = $this->format_error($error); break; //break here because currently we only show one error } - } + } } libxml_clear_errors(); |