summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-12-25 09:18:34 +0100
committerAndrew Dolgov <[email protected]>2006-12-25 09:18:34 +0100
commit83f114c8b9d29855fa6b7dbc1ae177cd406543fd (patch)
tree23818aec7dbe6110d58d44569126babdaea433a0 /functions.php
parent49f9c92303a0a669808c4fa6847243a18cdaccd0 (diff)
atom author field parsing fixes
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php16
1 files 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