From 83f114c8b9d29855fa6b7dbc1ae177cd406543fd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 25 Dec 2006 09:18:34 +0100 Subject: [PATCH] atom author field parsing fixes --- functions.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 201e290bb..afe3e4cd2 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