X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FMagic.php;h=491ed31cbd4a4bd0c24036ea45a398325d078251;hb=f3da5b3a2f98883e4a06c345dfe2880394f7d21d;hp=ecfe18e596b528b3587af7be1ae9b06b7201663a;hpb=d4a02dc31408210ab9f67ecac1948dc22b95b8da;p=friendica.git diff --git a/src/Module/Magic.php b/src/Module/Magic.php index ecfe18e596..491ed31cbd 100644 --- a/src/Module/Magic.php +++ b/src/Module/Magic.php @@ -28,10 +28,10 @@ class Magic extends BaseModule Logger::log('args: ' . print_r($_REQUEST, true), Logger::DATA); - $addr = ((x($_REQUEST, 'addr')) ? $_REQUEST['addr'] : ''); - $dest = ((x($_REQUEST, 'dest')) ? $_REQUEST['dest'] : ''); - $test = ((x($_REQUEST, 'test')) ? intval($_REQUEST['test']) : 0); - $owa = ((x($_REQUEST, 'owa')) ? intval($_REQUEST['owa']) : 0); + $addr = defaults($_REQUEST, 'addr', ''); + $dest = defaults($_REQUEST, 'dest', ''); + $test = (!empty($_REQUEST['test']) ? intval($_REQUEST['test']) : 0); + $owa = (!empty($_REQUEST['owa']) ? intval($_REQUEST['owa']) : 0); // NOTE: I guess $dest isn't just the profile url (could be also // other profile pages e.g. photo). We need to find a solution @@ -43,7 +43,7 @@ class Magic extends BaseModule } if (!$cid) { - Logger::log('No contact record found: ' . print_r($_REQUEST, true), Logger::DEBUG); + Logger::log('No contact record found: ' . json_encode($_REQUEST), Logger::DEBUG); // @TODO Finding a more elegant possibility to redirect to either internal or external URL $a->redirect($dest); } @@ -74,7 +74,7 @@ class Magic extends BaseModule $basepath = $exp[0]; $headers = []; - $headers['Accept'] = 'application/x-dfrn+json'; + $headers['Accept'] = 'application/x-dfrn+json, application/x-zot+json'; $headers['X-Open-Web-Auth'] = Strings::getRandomHex(); // Create a header that is signed with the local users private key.