/** * Clean up a path * If the path starts with a "/", it is deemed absolute and any /../ in the beginning is stripped off. * The returned path will not end in a "/". * * @param String $relPath The path to clean up * @return String the clean path * @deprecated Redundant, please use Zip::getRelativePath($relPath) instead. */ function relPath($relPath) { return Zip::getRelativePath($relPath); }
/** * Cleanup the filepath, and remove leading . and / characters. * * Sometimes, when a path is generated from multiple fragments, * you can get something like "../data/html/../images/image.jpeg" * ePub files don't work well with that, this will normalize that * example path to "data/images/image.jpeg" * * @param string $fileName * @return string normalized filename */ function normalizeFileName($fileName) { return preg_replace('#^[/\\.]+#i', "", Zip::getRelativePath($fileName)); }