*/
init: function() {
$('.loginLink').click($.proxy(this._render, this));
+
+ // prepend protocol and hostname
+ $('#loginForm input[name=url]').val(function(index, value) {
+ return window.location.protocol + '//' + window.location.host + value;
+ });
},
/**
public function readParameters() {
parent::readParameters();
- if (!empty($_REQUEST['url'])) $this->url = $_REQUEST['url'];
+ if (!empty($_REQUEST['url'])) {
+ $this->url = StringUtil::trim($_REQUEST['url']);
+
+ // discard URL if it is not an absolute URL of local content
+ if (!ApplicationHandler::getInstance()->isInternalURL($this->url)) {
+ $this->url = '';
+ }
+ }
}
/**
$this->useCookies = 0;
if (isset($_POST['useCookies'])) $this->useCookies = intval($_POST['useCookies']);
- if (isset($_POST['url'])) $this->url = StringUtil::trim($_POST['url']);
}
/**
$pageURL = $application->getPageURL();
}
- $path = $pageURL . 'acp/index.php/Login/' . SID_ARG_1ST . '&url=' . rawurlencode(WCF::getSession()->requestURI);
+ $path = $pageURL . 'acp/index.php/Login/' . SID_ARG_1ST . '&url=' . rawurlencode(RouteHandler::getProtocol() . $_SERVER['HTTP_HOST'] . WCF::getSession()->requestURI);
HeaderUtil::redirect($path);
exit;