From: Justin J. Novack Date: Tue, 18 Sep 2012 14:08:33 +0000 (-0400) Subject: CLEAN: use fullUrl when possible X-Git-Tag: v0.3.0~42^2~9 X-Git-Url: https://git.cweiske.de/phorkie.git/commitdiff_plain/ffa9d514d3a14c76170e26047f09009b4a6de07c?ds=sidebyside CLEAN: use fullUrl when possible --- diff --git a/www/login.php b/www/login.php index a2cf97c..9c1b136 100644 --- a/www/login.php +++ b/www/login.php @@ -77,7 +77,7 @@ if (isset($_POST['openid_url'])) { $authRequest->addExtension($ax); $url = $authRequest->getAuthorizeURL(); - + header("Location: $url"); exit; @@ -116,7 +116,7 @@ try { } catch (OpenID_Exception $e) { $status = "Status:EXCEPTION!"; $status .= " ({$e->getMessage()} : {$e->getCode()})"; - } +} $openid = $message->getArrayFormat(); @@ -149,7 +149,11 @@ $name = isset($openid['openid.sreg.fullname']) && !isset($name) $_SESSION['name'] = isset($name) ? $name : $_SERVER['REMOTE_ADDR']; $_SESSION['identity'] = $openid['openid.identity']; -$redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SESSION['REQUEST_URI']; +if (isset($_SESSION['REQUEST_URI'])) { + $redirect = Tools::fullUrl($_SESSION['REQUEST_URI']); +} else { + $redirect = Tools::fullUrl('/'); +} header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL)); exit; ?>