You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
538 B
28 lines
538 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace League\Flysystem;
|
|
|
|
use RuntimeException;
|
|
|
|
class PathTraversalDetected extends RuntimeException implements FilesystemException
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $path;
|
|
|
|
public function path(): string
|
|
{
|
|
return $this->path;
|
|
}
|
|
|
|
public static function forPath(string $path): PathTraversalDetected
|
|
{
|
|
$e = new PathTraversalDetected("Path traversal detected: {$path}");
|
|
$e->path = $path;
|
|
|
|
return $e;
|
|
}
|
|
}
|
|
|