Box\Spout\Common\Helper\FileSystemHelper::throwIfOperationNotInBaseFolder PHP Метод

throwIfOperationNotInBaseFolder() защищенный Метод

This function will throw an exception if the folder where the I/O operation should occur is not inside the base folder.
protected throwIfOperationNotInBaseFolder ( string $operationFolderPath ) : void
$operationFolderPath string The path of the folder where the I/O operation should occur
Результат void
    protected function throwIfOperationNotInBaseFolder($operationFolderPath)
    {
        $operationFolderRealPath = realpath($operationFolderPath);
        $isInBaseFolder = strpos($operationFolderRealPath, $this->baseFolderRealPath) === 0;
        if (!$isInBaseFolder) {
            throw new IOException("Cannot perform I/O operation outside of the base folder: {$this->baseFolderRealPath}");
        }
    }