bug #111 - don't parse an @ address as a feed

This commit is contained in:
Friendika 2011-08-01 16:15:37 -07:00
parent 326a873082
commit e76990ae7b
2 changed files with 8 additions and 4 deletions

View file

@ -1,6 +1,6 @@
<?php <?php
define ( 'FRIENDIKA_VERSION', '2.2.1058' ); define ( 'FRIENDIKA_VERSION', '2.2.1059' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1076 ); define ( 'DB_UPDATE_VERSION', 1076 );
@ -1743,10 +1743,12 @@ function fetch_xrd_links($url) {
$xml = fetch_url($url); $xml = fetch_url($url);
if (! $xml)
return array();
logger('fetch_xrd_links: ' . $xml, LOGGER_DATA); logger('fetch_xrd_links: ' . $xml, LOGGER_DATA);
if ((! $xml) || (! stristr($xml,'<xrd')))
return array();
$h = parse_xml_string($xml); $h = parse_xml_string($xml);
if(! $h) if(! $h)
return array(); return array();

View file

@ -294,6 +294,8 @@ function probe_url($url) {
$twitter = ((strpos($url,'twitter.com') !== false) ? true : false); $twitter = ((strpos($url,'twitter.com') !== false) ? true : false);
$at_addr = ((strpos($url,'@') !== false) ? true : false);
if(! $twitter) { if(! $twitter) {
$links = lrdd($url); $links = lrdd($url);
@ -452,7 +454,7 @@ function probe_url($url) {
$vcard['fn'] = $vcard['nick']; $vcard['fn'] = $vcard['nick'];
if(((! isset($vcard)) && (! $poll)) || ($twitter)) { if(((! isset($vcard)) && (! $poll) && (! $at_addr)) || ($twitter)) {
$feedret = scrape_feed($url); $feedret = scrape_feed($url);
logger('probe_url: scrape_feed returns: ' . print_r($feedret,true), LOGGER_DATA); logger('probe_url: scrape_feed returns: ' . print_r($feedret,true), LOGGER_DATA);