summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorChristian Weiske <[email protected]>2010-11-09 08:03:27 +0100
committerAndrew Dolgov <[email protected]>2010-11-10 07:15:47 +0300
commitf6d8345b0139ac4e86ea11f2183903a387a2a9fe (patch)
treed1aa5c3efe7a0017faf38f502251e61b2147c8c5 /functions.php
parent490c366d39126d8abab29547e8dd983ee254e859 (diff)
move url resolution before duplicate checks - otherwise we may get duplicates (refs #276)
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/functions.php b/functions.php
index c4d033bc2..fa97d04f9 100644
--- a/functions.php
+++ b/functions.php
@@ -2998,6 +2998,15 @@
$url = fix_url($url);
if (!validate_feed_url($url)) return 2;
+ if (url_is_html($url)) {
+ $feedUrls = get_feeds_from_html($url);
+ if (count($feedUrls) != 1) {
+ return 3;
+ }
+ //use feed url as new URL
+ $url = key($feedUrls);
+ }
+
if ($cat_id == "0" || !$cat_id) {
$cat_qpart = "NULL";
} else {
@@ -3009,15 +3018,6 @@
WHERE feed_url = '$url' AND owner_uid = ".$_SESSION["uid"]);
if (db_num_rows($result) == 0) {
- if (url_is_html($url)) {
- $feedUrls = get_feeds_from_html($url);
- if (count($feedUrls) != 1) {
- return 3;
- }
- //use feed url as new URL
- $url = key($feedUrls);
- }
-
$result = db_query($link,
"INSERT INTO ttrss_feeds
(owner_uid,feed_url,title,cat_id, auth_login,auth_pass)