-
Bug
-
Resolution: Fixed
-
Minor
-
3.0.RC1
-
None
-
PHP Environment:
Database:
The class compress_tar in file includes/functions_compress.php tries to determine the exact type of the tarball like this:
$this->isgz = (strpos($type, '.tar.gz') !== false || strpos($type, '.tgz') !== false) ? true : false;
$this->isbz = (strpos($type, '.tar.bz2') !== false) ? true : false;
Obviously, this can lead to problems on malformed filenames like foo.tgz.tar.bz2. The type would be determined as a gzip-compressed tarball, instead of a bzip-compressed one. It would be safer to match the type using a regular expression, including the end-of-string delimiter:
$this->isgz = (preg_match('#.tar.gz$#i', $type) ? .....
This doesn't affect Olympus itself, but could cause a problem if the class is used more widely.