From: Andrew Dolgov Date: Mon, 25 Dec 2006 08:18:34 +0000 (+0100) Subject: atom author field parsing fixes X-Git-Tag: 1.2.7~15 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=83f114c8b9d29855fa6b7dbc1ae177cd406543fd;p=tt-rss.git atom author field parsing fixes --- diff --git a/functions.php b/functions.php index 201e290b..afe3e4cd 100644 --- a/functions.php +++ b/functions.php @@ -513,10 +513,22 @@ $entry_author = db_escape_string(strip_tags($item['dc']['creator'])); - if (!$entry_author) { - $entry_author = db_escape_string(strip_tags($item['author'])); + if ($item['author']) { + if (!$entry_author) { + $entry_author = db_escape_string(strip_tags($item['author']['name'])); + } + + if (!$entry_author) { + $entry_author = db_escape_string(strip_tags($item['author']['email'])); + } + + if (!$entry_author) { + $entry_author = db_escape_string(strip_tags($item['author'])); + } } + if (preg_match('/^[\t\n\r ]*$/', $entry_author)) $entry_author = ''; + $entry_guid = db_escape_string(strip_tags($entry_guid)); $result = db_query($link, "SELECT id FROM ttrss_entries