public function checkPath($path = null)
    {
        if (is_null($path)) {
            $path = $this->getDir();
        }

        $real_path = realpath($path);
        if (!$real_path) {
            $real_path = realpath(dirname($path));
        }
        $upload_path = realpath($this->getUploadPath());

        if (strcasecmp($real_path, $upload_path) > 0) {
            return true;
        } else {
            throw new \Exception("Directory is not in the upload path", 403);
        }
    }
public function checkPath($path = null)
    {
        if (is_null($path)) {
            $path = $this->getDir();
        }

        $real_path = realpath($path);
        if (!$real_path) {
            $real_path = realpath(dirname($path));
        }
        $upload_path = realpath($this->getUploadPath());

        if (strcasecmp($real_path, $upload_path) > 0) {
            return true;
        } else {
            throw new \Exception("Directory is not in the upload path", 403);
        }
    }
public function checkPath ( $ path = null ) { if ( is_null ( $ path ) ) { $ path = $ this -> getDir ( ) ; } $ real_path = realpath ( $ path ) ; if ( ! $ real_path ) { $ real_path = realpath ( dirname ( $ path ) ) ; } $ upload_path = realpath ( $ this -> getUploadPath ( ) ) ; if ( strcasecmp ( $ real_path , $ upload_path ) > 0 ) { return true ; } else { throw new \ Exception ( "Directory is not in the upload path" , 403 ) ; } }
Check if the path is in the upload directory

@param string $path default is the file dir
@throws \Exception when directory is not in the upload path
@return bool
Check if the path is in the upload directory