protected function resolveInvalidRedirect()
    {
        if (empty($this->server['REDIRECT_URL'])) {
            return false;
        }

        $nodes = substr($this->server['SCRIPT_FILENAME'], strlen($this->server['DOCUMENT_ROOT']));
        $nodes = str_replace('\\', '/', $nodes);
        $nodes = substr($nodes, 0, strrpos($nodes, '/'));
        $nodes = explode('/', trim($nodes, '/'));
        $redirect = explode('/', trim($this->server['REDIRECT_URL'], '/'));

        $path = [];
        foreach ($nodes as $node) {
            if (!in_array($node, $redirect)) {
                $path[] = $node;
            }
        }

        return empty($path) ? false : '/' . implode('/', $path);
    }
protected function resolveInvalidRedirect()
    {
        if (empty($this->server['REDIRECT_URL'])) {
            return false;
        }

        $nodes = substr($this->server['SCRIPT_FILENAME'], strlen($this->server['DOCUMENT_ROOT']));
        $nodes = str_replace('\\', '/', $nodes);
        $nodes = substr($nodes, 0, strrpos($nodes, '/'));
        $nodes = explode('/', trim($nodes, '/'));
        $redirect = explode('/', trim($this->server['REDIRECT_URL'], '/'));

        $path = [];
        foreach ($nodes as $node) {
            if (!in_array($node, $redirect)) {
                $path[] = $node;
            }
        }

        return empty($path) ? false : '/' . implode('/', $path);
    }
protected function resolveInvalidRedirect ( ) { if ( empty ( $ this -> server [ 'REDIRECT_URL' ] ) ) { return false ; } $ nodes = substr ( $ this -> server [ 'SCRIPT_FILENAME' ] , strlen ( $ this -> server [ 'DOCUMENT_ROOT' ] ) ) ; $ nodes = str_replace ( '\\' , '/' , $ nodes ) ; $ nodes = substr ( $ nodes , 0 , strrpos ( $ nodes , '/' ) ) ; $ nodes = explode ( '/' , trim ( $ nodes , '/' ) ) ; $ redirect = explode ( '/' , trim ( $ this -> server [ 'REDIRECT_URL' ] , '/' ) ) ; $ path = [ ] ; foreach ( $ nodes as $ node ) { if ( ! in_array ( $ node , $ redirect ) ) { $ path [ ] = $ node ; } } return empty ( $ path ) ? false : '/' . implode ( '/' , $ path ) ; }
Resolves invalid redirection path

@return string
Resolves invalid redirection path