aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-08 19:07:19 -0800
committerfriendica <info@friendica.com>2012-11-08 19:07:19 -0800
commit22841e15666a6678517cf7a1f8f8791dcd37e1a6 (patch)
treed67dcb866e78fdab995529615ff78396396c6ab1 /boot.php
parentf66a3d26befeb9966d9059164864c49d1f5a7721 (diff)
downloadvolse-hubzilla-22841e15666a6678517cf7a1f8f8791dcd37e1a6.tar.gz
volse-hubzilla-22841e15666a6678517cf7a1f8f8791dcd37e1a6.tar.bz2
volse-hubzilla-22841e15666a6678517cf7a1f8f8791dcd37e1a6.zip
start implementing zot-id
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/boot.php b/boot.php
index fca06f57c..8e8b92593 100644
--- a/boot.php
+++ b/boot.php
@@ -1829,26 +1829,33 @@ function get_my_url() {
return false;
}
-function zrl_init(&$a) {
+function get_my_address() {
+ if(x($_SESSION,'my_address'))
+ return $_SESSION['my_address'];
+ return false;
+}
+
+function zid_init(&$a) {
$tmp_str = get_my_url();
if(validate_url($tmp_str)) {
proc_run('php','include/gprobe.php',bin2hex($tmp_str));
- $arr = array('zrl' => $tmp_str, 'url' => $a->cmd);
- call_hooks('zrl_init',$arr);
+ $arr = array('zid' => $tmp_str, 'url' => $a->cmd);
+ call_hooks('zid_init',$arr);
}
}
-function zrl($s,$force = false) {
+function zid($s,$force = false) {
if(! strlen($s))
return $s;
- if((! strpos($s,'/channel/')) && (! $force))
- return $s;
- if($force && substr($s,-1,1) !== '/')
- $s = $s . '/';
+ $has_params = ((strpos($s,'?')) ? true : false);
+ if(! $has_params)
+ $has_params = ((strpos($s,'&')) ? true : false);
$achar = strpos($s,'?') ? '&' : '?';
+
$mine = get_my_url();
+ $myaddr = get_my_address();
if($mine and ! link_compare($mine,$s))
- return $s . $achar . 'zrl=' . urlencode($mine);
+ return $s . (($has_params) ? '' : '/') . $achar . 'zid=' . urlencode($myaddr);
return $s;
}