1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-10-11 21:34:39 +02:00
This commit is contained in:
wapplay
2019-07-25 23:03:28 +03:00
parent 97db60a52d
commit a84d2f9eff
3 changed files with 73 additions and 12 deletions

View File

@@ -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 !== '..';
}
)
);
}
}