original_string: 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);
          }
      }
code: 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);
          }
      }
code_tokens: 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 ) ; } }
docstring: 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
docstring_tokens: Check if the path is in the upload directory