urlencode query_string for magic auth to make sure GET params make it back

to the originating server
This commit is contained in:
zottel 2014-01-09 15:59:42 +01:00
parent c6b9e44353
commit cd65d172ba

View File

@ -1023,7 +1023,7 @@ function zid_init(&$a) {
dbesc($tmp_str) dbesc($tmp_str)
); );
// try to avoid recursion - but send them home to do a proper magic auth // try to avoid recursion - but send them home to do a proper magic auth
$dest = '/' . $a->query_string; $dest = '/' . urlencode($a->query_string);
$dest = str_replace(array('?zid=','&zid='),array('?rzid=','&rzid='),$dest); $dest = str_replace(array('?zid=','&zid='),array('?rzid=','&rzid='),$dest);
if($r && ($r[0]['hubloc_url'] != z_root()) && (! strstr($dest,'/magic')) && (! strstr($dest,'/rmagic'))) { if($r && ($r[0]['hubloc_url'] != z_root()) && (! strstr($dest,'/magic')) && (! strstr($dest,'/rmagic'))) {
goaway($r[0]['hubloc_url'] . '/magic' . '?f=&rev=1&dest=' . z_root() . $dest); goaway($r[0]['hubloc_url'] . '/magic' . '?f=&rev=1&dest=' . z_root() . $dest);