mirror of
https://github.com/easy-wi/developer.git
synced 2025-02-20 11:23:28 +08:00
FIX #1020
This commit is contained in:
parent
9d262f6c2d
commit
5736b40469
@ -79,7 +79,7 @@ if ($ui->st('w', 'get') == 'lo') {
|
||||
|
||||
if (isset($ui->server['HTTP_REFERER'])) {
|
||||
$refstring = explode('/', substr(str_replace(array('http://' . $ui->domain('HTTP_HOST', 'server'), 'https://' . $ui->domain('HTTP_HOST', 'server'), '//'), array('', '', '/'), strtolower($ui->server['HTTP_REFERER'])), strlen($ewInstallPath)));
|
||||
$referrer = (isset($refstring[1])) ? explode('?',$refstring[1]) : '';
|
||||
$referrer = (isset($refstring[1])) ? explode('?', $refstring[1]) : '';
|
||||
} else {
|
||||
$referrer[0] = 'login.php';
|
||||
}
|
||||
@ -101,9 +101,12 @@ if ($ui->st('w', 'get') == 'lo') {
|
||||
redirect('admin.php');
|
||||
|
||||
} else {
|
||||
$target = (isset($pageurl)) ? $pageurl . '/' . $ewInstallPath : $ewInstallPath;
|
||||
$target .= (empty($target)) ? 'login.php' : '/login.php';
|
||||
|
||||
session_unset();
|
||||
session_destroy();
|
||||
redirect((isset($pageurl)) ? $pageurl . '/' . $ewInstallPath : $ewInstallPath);
|
||||
redirect($target);
|
||||
}
|
||||
|
||||
} else if ($ui->st('w', 'get') == 'ba') {
|
||||
|
@ -165,21 +165,17 @@ if (!function_exists('passwordgenerate')) {
|
||||
|
||||
function redirect($value, $sendHTTP301 = false) {
|
||||
|
||||
$value = removeDoubleSlashes($value);
|
||||
$target = removeDoubleSlashes($value);
|
||||
|
||||
if ($value == 'login.php') {
|
||||
if (substr($target, -9) == 'login.php') {
|
||||
if (session_status() === PHP_SESSION_ACTIVE) {
|
||||
session_unset();
|
||||
session_destroy();
|
||||
}
|
||||
}
|
||||
|
||||
if ($sendHTTP301 == true) {
|
||||
header('HTTP/1.1 301 Moved Permanently');
|
||||
}
|
||||
|
||||
header ('Location: ' . $value);
|
||||
die('Please allow redirection settings');
|
||||
header ('Location: ' . $target, true, ($sendHTTP301 == true) ? 301 : 302);
|
||||
die('Please allow redirection or manually navigate to ' . $value);
|
||||
}
|
||||
|
||||
function listDirs ($dir) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user