aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-17 21:14:21 -0700
committerFriendika <info@friendika.com>2011-08-17 21:14:21 -0700
commit37fc7324b702faa1fe74808b7d3e73389d136f09 (patch)
tree2df15ccd44b1810ec9cf7fff93b95b76b1726f96
parentc30f523c6200ef84c506940b5f86b49ff2c7cf6e (diff)
downloadvolse-hubzilla-37fc7324b702faa1fe74808b7d3e73389d136f09.tar.gz
volse-hubzilla-37fc7324b702faa1fe74808b7d3e73389d136f09.tar.bz2
volse-hubzilla-37fc7324b702faa1fe74808b7d3e73389d136f09.zip
fix largest_photo mixup in probe_url
-rw-r--r--include/Scrape.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/Scrape.php b/include/Scrape.php
index bfe795e19..dbd98c9ec 100644
--- a/include/Scrape.php
+++ b/include/Scrape.php
@@ -498,10 +498,11 @@ function probe_url($url) {
logger('probe_url: scrape_feed returns: ' . print_r($feedret,true), LOGGER_DATA);
if(count($feedret) && ($feedret['feed_atom'] || $feedret['feed_rss'])) {
$poll = ((x($feedret,'feed_atom')) ? unamp($feedret['feed_atom']) : unamp($feedret['feed_rss']));
- $vcard = array();
+ if(! x($vcard))
+ $vcard = array();
}
- if(x($feedret,'photo'))
+ if(x($feedret,'photo') && (! x($vcard,'photo')))
$vcard['photo'] = $feedret['photo'];
require_once('library/simplepie/simplepie.inc');
$feed = new SimplePie();
@@ -518,9 +519,11 @@ function probe_url($url) {
if($feed->error())
logger('probe_url: scrape_feed: Error parsing XML: ' . $feed->error());
+
if(! x($vcard,'photo'))
$vcard['photo'] = $feed->get_image_url();
$author = $feed->get_author();
+
if($author) {
$vcard['fn'] = unxmlify(trim($author->get_name()));
if(! $vcard['fn'])
@@ -568,6 +571,7 @@ function probe_url($url) {
}
}
}
+
if((! $vcard['photo']) && strlen($email))
$vcard['photo'] = gravatar_img($email);
if($poll === $profile)