original_string: protected function _checkFilePath($file, $path)
      {
          if (strpos($file, '..') === false) {
              return $file;
          }
          $absolute = realpath($file);
          if (strpos($absolute, $path) !== 0) {
              throw new InvalidArgumentException(sprintf(
                  'Cannot use "%s" as a template, it is not within any view template path.',
                  $file
              ));
          }
  
          return $absolute;
      }
code: protected function _checkFilePath($file, $path)
      {
          if (strpos($file, '..') === false) {
              return $file;
          }
          $absolute = realpath($file);
          if (strpos($absolute, $path) !== 0) {
              throw new InvalidArgumentException(sprintf(
                  'Cannot use "%s" as a template, it is not within any view template path.',
                  $file
              ));
          }
  
          return $absolute;
      }
code_tokens: protected function _checkFilePath ( $ file , $ path ) { if ( strpos ( $ file , '..' ) === false ) { return $ file ; } $ absolute = realpath ( $ file ) ; if ( strpos ( $ absolute , $ path ) !== 0 ) { throw new InvalidArgumentException ( sprintf ( 'Cannot use "%s" as a template, it is not within any view template path.' , $ file ) ) ; } return $ absolute ; }
docstring: Check that a view file path does not go outside of the defined template paths.
  
  Only paths that contain `..` will be checked, as they are the ones most likely to
  have the ability to resolve to files outside of the template paths.
  
  @param string $file The path to the template file.
  @param string $path Base path that $file should be inside of.
  @return string The file path
  @throws \InvalidArgumentException
docstring_tokens: Check that a view file path does not go outside of the defined template paths .