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;
    }
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;
    }
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 ; }
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
Check that a view file path does not go outside of the defined template paths .