Skip to content

Commit

Permalink
bugfix for redirect $target #1086
Browse files Browse the repository at this point in the history
  • Loading branch information
teiling88 committed Aug 28, 2017
1 parent 0327b04 commit ed4f18b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion htdocs/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@
$tpl->assign('error', LOGIN_OK);

$target = isset($_REQUEST['target']) ? $_REQUEST['target'] : 'myhome.php';
if (mb_strtolower(mb_substr($target, 0, 9)) == 'login.php') {

// #1086 important change don't delete it :-)
$path = parse_url($target, PHP_URL_PATH);
if ((($path && !file_exists(__DIR__ . '/' . $path)) || !$path) && strpos($target, 'okapi/apps/') !== 0) {
$target = 'myhome.php';
}

if (mb_strtolower(mb_substr($target, 0, 9)) === 'login.php') {
$target = 'myhome.php';
}

Expand Down

0 comments on commit ed4f18b

Please sign in to comment.