mirror of
https://github.com/Ne-Lexa/php-zip.git
synced 2025-10-11 21:34:39 +02:00
fix issue #39
This commit is contained in:
@@ -225,4 +225,23 @@ class FilesUtil
|
||||
}
|
||||
return number_format($size) . " bytes";
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes zip path.
|
||||
*
|
||||
* @param string $path Zip path
|
||||
* @return string
|
||||
*/
|
||||
public static function normalizeZipPath($path)
|
||||
{
|
||||
return implode(
|
||||
'/',
|
||||
array_filter(
|
||||
explode('/', (string)$path),
|
||||
static function ($part) {
|
||||
return $part !== '.' && $part !== '..';
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user