Skip to content

Commit

Permalink
Ensure hostname is terminated
Browse files Browse the repository at this point in the history
  • Loading branch information
collectiveaccess committed Nov 22, 2021
1 parent 3e429d2 commit a45392d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/system/AuthController.php
Expand Up @@ -219,7 +219,7 @@ private function _getRedirectUrl() {
$redirect_url = $this->request->getParameter('redirect', pString, null, ['forcePurify' => true]) ?: caNavUrl($this->request, null, null, null);

$redirect_url = preg_replace("![^A-Za-z0-9/:\?\._\*\+\-]+.*!", '', $redirect_url);
if(!preg_match('!^'.preg_quote($host, '!').'!', $redirect_url)) {
if(!preg_match('!^'.preg_quote("{$host}/", '!').'!', $redirect_url)) {
$redirect_url = null;
}
return $redirect_url;
Expand Down

0 comments on commit a45392d

Please sign in to comment.