Project

General

Profile

« Previous | Next » 

Revision 1834

Added by Dietmar almost 12 years ago

  1. fixed redirect checking in class.login.php

View differences:

class.login.php
69 69
			$this->password_len = strlen($this->password);
70 70
		}
71 71

  
72
		$aServerUrl = $this->mb_parse_url(WB_URL);
73

  
72 74
        $sServerUrl = $_SERVER['SERVER_NAME'];        
73
        $sServerScheme = $_SERVER['REQUEST_SCHEME'];        
75
        $sServerScheme = isset($_SERVER['REQUEST_SCHEME']) ? $_SERVER['REQUEST_SCHEME'] : isset($aServerUrl['scheme']) ? $aServerUrl['scheme'] : ' http';        
74 76
        $sServerPath = $_SERVER['SCRIPT_NAME'];        
75 77
		// If the url is blank, set it to the default url
76 78
		$this->url = $this->get_post('url');
77
        $aUrl = parse_url( $this->url );
79
        $aUrl = $this->mb_parse_url( $this->url );
78 80
        $this->url = isset($aRedirecthUrl['host']) &&($sServerUrl==$aUrl['host']) ? $this->url:ADMIN_URL.'/start/index.php';        
79 81
		if ($this->redirect_url!='') {
80
            $aRedirecthUrl = parse_url( $this->redirect_url );
82
            $aRedirecthUrl = $this->mb_parse_url( $this->redirect_url );
81 83
            $this->redirect_url = isset($aRedirecthUrl['host']) &&($sServerUrl==$aRedirecthUrl['host']) ? $this->redirect_url:$sServerScheme.'://'.$sServerUrl;        
82 84
			$this->url = $this->redirect_url;
83 85
		}
84 86
		if(strlen($this->url) < 2) {
85
            $aDefaultUrl = parse_url( $this->default_url );
87
            $aDefaultUrl = $this->mb_parse_url( $this->default_url );
86 88
            $this->default_url = isset($aDefaultUrl['host']) &&($sServerUrl==$aDefaultUrl['host']) ? $this->default_url:$sServerScheme.'://'.$sServerUrl;        
87 89
			$this->url = $this->default_url;
88 90
		}

Also available in: Unified diff