From f0a8150b1160e47d7d2865836240f973292ac68d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 16 Oct 2009 13:18:32 +0000 Subject: - Patch #604618 by axyjo, sun: archiver code clean-up. --- includes/archiver.inc | 1 + includes/common.inc | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'includes') diff --git a/includes/archiver.inc b/includes/archiver.inc index 8d514794a..caf0a0ca0 100644 --- a/includes/archiver.inc +++ b/includes/archiver.inc @@ -1,4 +1,5 @@ filter_xss_admin(variable_get('maintenance_mode_message', - t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal'))))))); + t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal'))))))); break; } } @@ -5983,16 +5983,16 @@ function archiver_get_archiver($file) { $archiver_info = archiver_get_info(); foreach ($archiver_info as $implementation) { - foreach ($implementation['extensions'] as $extension) { - // Because extensions may be multi-part, such as .tar.gz, - // we cannot use simpler approaches like substr() or pathinfo(). - // This method isn't quite as clean but gets the job done. - // Also note that the file may not yet exist, so we cannot rely - // on fileinfo() or other disk-level utilities. - if (strrpos($file, '.' . $extension) === strlen($file) - strlen('.' . $extension)) { - return new $implementation['class']($file); - } - } + foreach ($implementation['extensions'] as $extension) { + // Because extensions may be multi-part, such as .tar.gz, + // we cannot use simpler approaches like substr() or pathinfo(). + // This method isn't quite as clean but gets the job done. + // Also note that the file may not yet exist, so we cannot rely + // on fileinfo() or other disk-level utilities. + if (strrpos($file, '.' . $extension) === strlen($file) - strlen('.' . $extension)) { + return new $implementation['class']($file); + } + } } } -- cgit v1.2.3