From abc84f96ab4d669f82da88ee472f0648a69ba347 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 13 Jun 2015 21:58:40 +0200 Subject: [PATCH 1/2] The installation prozess has a problem with self signed certificates. --- mod/install.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/mod/install.php b/mod/install.php index c6fe70836..ed07c4ea6 100755 --- a/mod/install.php +++ b/mod/install.php @@ -466,16 +466,19 @@ function check_htaccess(&$checks) { $status = true; $help = ""; if (function_exists('curl_init')){ - $test = fetch_url($a->get_baseurl()."/install/testrewrite"); - if ($test!="ok") { - $status = false; - $help = t('Url rewrite in .htaccess is not working. Check your server configuration.'); - } - check_add($checks, t('Url rewrite is working'), $status, true, $help); - } else { - // cannot check modrewrite if libcurl is not installed - } + $test = fetch_url($a->get_baseurl()."/install/testrewrite"); + if ($test!="ok") + $test = fetch_url(normalise_link($a->get_baseurl()."/install/testrewrite")); + + if ($test!="ok") { + $status = false; + $help = t('Url rewrite in .htaccess is not working. Check your server configuration.'); + } + check_add($checks, t('Url rewrite is working'), $status, true, $help); + } else { + // cannot check modrewrite if libcurl is not installed + } } From b22296d454e8b3a8fbaffe69372fa73a175ae609 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 14 Jun 2015 01:49:14 +0200 Subject: [PATCH 2/2] Better support for non standard installations of GNU Social in "probe_url" --- include/Scrape.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/include/Scrape.php b/include/Scrape.php index 1bb1998b0..90fb1a9e3 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -335,7 +335,7 @@ function scrape_feed($url) { define ( 'PROBE_NORMAL', 0); define ( 'PROBE_DIASPORA', 1); -function probe_url($url, $mode = PROBE_NORMAL) { +function probe_url($url, $mode = PROBE_NORMAL, $level = 1) { require_once('include/email.php'); $result = array(); @@ -804,13 +804,23 @@ function probe_url($url, $mode = PROBE_NORMAL) { logger('probe_url: ' . print_r($result,true), LOGGER_DEBUG); - // Trying if it maybe a diaspora account - if (($result['network'] == NETWORK_FEED) OR ($result['addr'] == "")) { - require_once('include/bbcode.php'); - $address = GetProfileUsername($url, "", true); - $result2 = probe_url($address, $mode); - if ($result2['network'] != "") - $result = $result2; + if ($level == 1) { + // Trying if it maybe a diaspora account + if (($result['network'] == NETWORK_FEED) OR ($result['addr'] == "")) { + require_once('include/bbcode.php'); + $address = GetProfileUsername($url, "", true); + $result2 = probe_url($address, $mode, ++$level); + if ($result2['network'] != "") + $result = $result2; + } + + // Maybe it's some non standard GNU Social installation (Single user, subfolder or no uri rewrite) + if (($result['network'] == NETWORK_FEED) AND ($result['baseurl'] != "") AND ($result['nick'] != "")) { + $addr = $result['nick'].'@'.str_replace("http://", "", $result['baseurl']); + $result2 = probe_url($addr, $mode, ++$level); + if (($result2['network'] != "") AND ($result2['network'] != NETWORK_FEED)) + $result = $result2; + } } Cache::set("probe_url:".$mode.":".$url,serialize($result));