From 2c94d59cba0b3231b0dd822fc1b95bed5521c48d Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 2 Sep 2014 17:21:12 -0700 Subject: use feed title for channel name before checking author, make feed items shareable (they're private to the channel so they won't be shown in searches), try and handle Diaspora mentions a bit more elegantly. (Bug: we don't convert mentions to Diaspora's format on outbound at all!) --- include/network.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index c44ed77c4..77c1550ba 100644 --- a/include/network.php +++ b/include/network.php @@ -868,15 +868,18 @@ function discover_by_url($url,$arr = null) { if($feed->error()) logger('probe_url: scrape_feed: Error parsing XML: ' . $feed->error()); + $name = unxmlify(trim($feed->get_title())); $photo = $feed->get_image_url(); $author = $feed->get_author(); if($author) { - $name = unxmlify(trim($author->get_name())); if(! $name) + $name = unxmlify(trim($author->get_name())); + if(! $name) { $name = trim(unxmlify($author->get_email())); - if(strpos($name,'@') !== false) - $name = substr($name,0,strpos($name,'@')); + if(strpos($name,'@') !== false) + $name = substr($name,0,strpos($name,'@')); + } if(! $profile && $author->get_link()) $profile = trim(unxmlify($author->get_link())); if(! $photo) { @@ -924,8 +927,7 @@ function discover_by_url($url,$arr = null) { if(! $network) { $network = 'rss'; } - if(! $name) - $name = notags($feed->get_title()); + if(! $name) $name = notags($feed->get_description()); -- cgit v1.2.3 From c7decf70a2d11dc2e208a508a0e7503139ab18c9 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 2 Sep 2014 17:43:42 -0700 Subject: feed removal issue --- include/network.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index 77c1550ba..5ca60b5fe 100644 --- a/include/network.php +++ b/include/network.php @@ -896,11 +896,13 @@ function discover_by_url($url,$arr = null) { if($item) { $author = $item->get_author(); if($author) { - $name = trim(unxmlify($author->get_name())); - if(! $name) - $name = trim(unxmlify($author->get_email())); - if(strpos($name,'@') !== false) - $name = substr($name,0,strpos($name,'@')); + if(! $name) { + $name = trim(unxmlify($author->get_name())); + if(! $name) + $name = trim(unxmlify($author->get_email())); + if(strpos($name,'@') !== false) + $name = substr($name,0,strpos($name,'@')); + } if(! $profile && $author->get_link()) $profile = trim(unxmlify($author->get_link())); } -- cgit v1.2.3 From ca2bf76b06360d6bd3dc386d53c6d7301cd518f3 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 4 Sep 2014 01:13:01 -0700 Subject: allow stuff with Diaspora authors to federate in zot conversations even if the local site has diaspora disabled. This way it won't look like folks are talking to themselves. --- include/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index 5ca60b5fe..5ad391491 100644 --- a/include/network.php +++ b/include/network.php @@ -1033,7 +1033,7 @@ function discover_by_webbie($webbie) { } } - if($diaspora && $diaspora_base && $diaspora_guid && intval(get_config('system','diaspora_enabled'))) { + if($diaspora && $diaspora_base && $diaspora_guid) { $guid = $diaspora_guid; $diaspora_base = trim($diaspora_base,'/'); -- cgit v1.2.3 From 386156138f63fbabf9ac71a81a6bea99410c8100 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 9 Sep 2014 02:42:07 -0700 Subject: syntax error in dba driver, document z_post_url --- include/network.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index 5ad391491..543c6aa72 100644 --- a/include/network.php +++ b/include/network.php @@ -132,6 +132,35 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { } +/** + * @function z_fetch_url + * @param string $url + * URL to fetch + * @param mixed $params + * The full data to post in a HTTP "POST" operation. To post a file, + * prepend a filename with @ and use the full path. The filetype can + * be explicitly specified by following the filename with the type in + * the format ';type=mimetype'. This parameter can either be passed + * as a urlencoded string like 'para1=val1¶2=val2&...' or as an + * array with the field name as key and field data as value. If value + * is an array, the Content-Type header will be set to multipart/form-data. + * As of PHP 5.2.0, value must be an array if files are passed to this + * option with the @ prefix. As of PHP 5.5.0, the @ prefix is deprecated + * and files can be sent using CURLFile. + * @param int $redirects = 0 + * internal use, recursion counter + * @param array $opts (optional parameters) + * 'accept_content' => supply Accept: header with 'accept_content' as the value + * 'timeout' => int seconds, default system config value or 60 seconds + * 'http_auth' => username:password + * 'novalidate' => do not validate SSL certs, default is to validate using our CA list + * + * @returns array + * 'return_code' => HTTP return code or 0 if timeout or failure + * 'success' => boolean true (if HTTP 2xx result) or false + * 'header' => HTTP headers + * 'body' => fetched content + */ function z_post_url($url,$params, $redirects = 0, $opts = array()) { -- cgit v1.2.3 From 409c89d629993b59eaafa8443ae9d0b5f0344c1f Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 9 Sep 2014 04:10:01 -0700 Subject: doco correction --- include/network.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index 543c6aa72..0191f203d 100644 --- a/include/network.php +++ b/include/network.php @@ -133,20 +133,14 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { /** - * @function z_fetch_url + * @function z_post_url * @param string $url - * URL to fetch + * URL to post * @param mixed $params - * The full data to post in a HTTP "POST" operation. To post a file, - * prepend a filename with @ and use the full path. The filetype can - * be explicitly specified by following the filename with the type in - * the format ';type=mimetype'. This parameter can either be passed - * as a urlencoded string like 'para1=val1¶2=val2&...' or as an - * array with the field name as key and field data as value. If value + * The full data to post in a HTTP "POST" operation. This parameter can + * either be passed as a urlencoded string like 'para1=val1¶2=val2&...' + * or as an array with the field name as key and field data as value. If value * is an array, the Content-Type header will be set to multipart/form-data. - * As of PHP 5.2.0, value must be an array if files are passed to this - * option with the @ prefix. As of PHP 5.5.0, the @ prefix is deprecated - * and files can be sent using CURLFile. * @param int $redirects = 0 * internal use, recursion counter * @param array $opts (optional parameters) -- cgit v1.2.3