aboutsummaryrefslogtreecommitdiffstats
path: root/include/notifier.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-04-02 23:07:26 -0700
committerfriendica <info@friendica.com>2012-04-02 23:07:26 -0700
commit5d0d9f877294258cb90e1c496b4db750ee99f3ca (patch)
tree76e322f19d3ada0106a2c7c9664537e602ed88ed /include/notifier.php
parentf4721955dbfb23992c4acdadd05108cb1b92e2af (diff)
downloadvolse-hubzilla-5d0d9f877294258cb90e1c496b4db750ee99f3ca.tar.gz
volse-hubzilla-5d0d9f877294258cb90e1c496b4db750ee99f3ca.tar.bz2
volse-hubzilla-5d0d9f877294258cb90e1c496b4db750ee99f3ca.zip
make contact ssl_policy change a function since it is used in a few places
Diffstat (limited to 'include/notifier.php')
-rwxr-xr-xinclude/notifier.php47
1 files changed, 4 insertions, 43 deletions
diff --git a/include/notifier.php b/include/notifier.php
index e91185c51..ca7c7b92e 100755
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -537,56 +537,17 @@ function notifier_run($argv, $argc){
$x[0]['writable'] = 1;
}
+ // if contact's ssl policy changed, which we just determined
+ // is on our own server, update our contact links
+
$ssl_policy = get_config('system','ssl_policy');
- // if contact's ssl policy changed, update our links
-
- $ssl_changed = false;
-
- if($ssl_policy == SSL_POLICY_SELFSIGN && strstr($x[0]['url'],'https:')) {
- $ssl_changed = true;
- $x[0]['url'] = str_replace('https:','http:',$x[0]['url']);
- $x[0]['request'] = str_replace('https:','http:',$x[0]['request']);
- $x[0]['notify'] = str_replace('https:','http:',$x[0]['notify']);
- $x[0]['poll'] = str_replace('https:','http:',$x[0]['poll']);
- $x[0]['confirm'] = str_replace('https:','http:',$x[0]['confirm']);
- $x[0]['poco'] = str_replace('https:','http:',$x[0]['poco']);
- }
-
- if($ssl_policy == SSL_POLICY_FULL && strstr($x[0]['url'],'http:')) {
- $ssl_changed = true;
- $x[0]['url'] = str_replace('http:','https:',$x[0]['url']);
- $x[0]['request'] = str_replace('http:','https:',$x[0]['request']);
- $x[0]['notify'] = str_replace('http:','https:',$x[0]['notify']);
- $x[0]['poll'] = str_replace('http:','https:',$x[0]['poll']);
- $x[0]['confirm'] = str_replace('http:','https:',$x[0]['confirm']);
- $x[0]['poco'] = str_replace('http:','https:',$x[0]['poco']);
- }
+ fix_contact_ssl_policy($x[0],$ssl_policy);
- if($ssl_changed) {
- q("update contact set
- url = '%s',
- request = '%s',
- notify = '%s',
- poll = '%s',
- confirm = '%s',
- poco = '%s'
- where id = %d limit 1",
- dbesc($x[0]['url']),
- dbesc($x[0]['request']),
- dbesc($x[0]['notify']),
- dbesc($x[0]['poll']),
- dbesc($x[0]['confirm']),
- dbesc($x[0]['poco']),
- intval($x[0]['id'])
- );
- }
-
// If we are setup as a soapbox we aren't accepting input from this person
if($x[0]['page-flags'] == PAGE_SOAPBOX)
break;
-
require_once('library/simplepie/simplepie.inc');
logger('mod-delivery: local delivery');
local_delivery($x[0],$atom);