diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/_well_known.php | 6 | ||||
-rw-r--r-- | mod/item.php | 8 | ||||
-rwxr-xr-x | mod/setup.php | 36 |
3 files changed, 35 insertions, 15 deletions
diff --git a/mod/_well_known.php b/mod/_well_known.php index 885ff9b50..d88bc2391 100644 --- a/mod/_well_known.php +++ b/mod/_well_known.php @@ -3,6 +3,10 @@ function _well_known_init(&$a){
if(argc() > 1) {
+
+ $arr = array('server' => $_SERVER, 'request' => $_REQUEST);
+ call_hooks('well_known', $arr);
+
switch(argv(1)) {
case 'zot-info':
$a->argc -= 1;
@@ -19,6 +23,7 @@ function _well_known_init(&$a){ require_once('mod/wfinger.php');
wfinger_init($a);
break;
+
case 'host-meta':
$a->argc -= 1;
array_shift($a->argv);
@@ -26,6 +31,7 @@ function _well_known_init(&$a){ require_once('mod/hostxrd.php');
hostxrd_init($a);
break;
+
default:
break;
diff --git a/mod/item.php b/mod/item.php index d1952c60e..164b345f0 100644 --- a/mod/item.php +++ b/mod/item.php @@ -643,11 +643,11 @@ function item_post(&$a) { $datarray['owner_xchan'] = (($owner_hash) ? $owner_hash : $owner_xchan['xchan_hash']); $datarray['author_xchan'] = $observer['xchan_hash']; $datarray['created'] = $created; - $datarray['edited'] = datetime_convert(); + $datarray['edited'] = (($orig_post) ? datetime_convert() : $created); $datarray['expires'] = $expires; - $datarray['commented'] = datetime_convert(); - $datarray['received'] = datetime_convert(); - $datarray['changed'] = datetime_convert(); + $datarray['commented'] = (($orig_post) ? datetime_convert() : $created); + $datarray['received'] = (($orig_post) ? datetime_convert() : $created); + $datarray['changed'] = (($orig_post) ? datetime_convert() : $created); $datarray['mid'] = $mid; $datarray['parent_mid'] = $parent_mid; $datarray['mimetype'] = $mimetype; diff --git a/mod/setup.php b/mod/setup.php index 07ad34ac5..9eccffe75 100755 --- a/mod/setup.php +++ b/mod/setup.php @@ -545,22 +545,36 @@ function check_htaccess(&$checks) { $a = get_app(); $status = true; $help = ""; + $ssl_error = false; + + $url = $a->get_baseurl() . '/test/rewrite'; + if (function_exists('curl_init')){ - $test = z_fetch_url($a->get_baseurl()."/setup/testrewrite"); + $test = z_fetch_url($url); if(! $test['success']) { - if(strstr($a->get_baseurl(),'https://')) { - $test = z_fetch_url($a->get_baseurl() . "/setup/testrewrite",false,0,array('novalidate' => true)); + if(strstr($url,'https://')) { + $test = z_fetch_url($url,false,0,array('novalidate' => true)); + if($test['success']) { + $ssl_error = true; + } + } + else { + $test = z_fetch_url(str_replace('http://','https://',$url),false,0,array('novalidate' => true)); if($test['success']) { - $help = t('SSL certificate cannot be validated. Fix certificate or disable https access to this site.') . EOL; - $help .= t('If you use https access, you MUST use a certification instance known by all internet browsers. You MUST NOT use self-signed certificates!') . EOL; - $help .= t('This restriction is incorporated because public posts from you may for example contain references to images on your own hub. If your') . EOL; - $help .= t('certificate is not known by the internet browser of users they get a warning message complaining about some security issues. Although') . EOL; - $help .= t('these complains are not the real truth - there are no security issues with your encryption! - the users may be confused, nerved or even') .EOL; - $help .= t('worse may become scared about redmatrix having security issues. Use one of the free certification instances!') . EOL; - - check_add($checks, t('SSL certificate validation'),false,true, $help); + $ssl_error = true; } } + + if($ssl_error) { + $help = t('SSL certificate cannot be validated. Fix certificate or disable https access to this site.') . EOL; + $help .= t('If you have https access to your website or allow connections to TCP port 443 (the https: port), you MUST use a browser-valid certificate. You MUST NOT use self-signed certificates!') . EOL; + $help .= t('This restriction is incorporated because public posts from you may for example contain references to images on your own hub.') . EOL; + $help .= t('If your certificate is not recognised, members of other sites (who may themselves have valid certificates) will get a warning message on their own site complaining about security issues.') . EOL; + $help .= t('This can cause usability issues elsewhere (not just on your own site) so we must insist on this requirement.') .EOL; + $help .= t('Providers are available that issue free certificates which are browser-valid.'). EOL; + + check_add($checks, t('SSL certificate validation'),false,true, $help); + } } if ((! $test['success']) || ($test['body'] != "ok")) { |