From 0de52de6468842f65076f6bbf944f75a86ba6595 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 29 Jul 2010 02:27:43 +0000 Subject: - Patch #747252 by justinrandell, dhthwy, aspilicious: cannot extract themes and modules. --- includes/common.inc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index 725b20b68..9be957332 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -6777,6 +6777,27 @@ function archiver_get_info() { return $archiver_info; } +/** + * Returns a string of supported archive extensions. + * + * @return + * A space-separated string of extensions suitable for use by the file + * validation system. + */ +function archiver_get_extensions() { + $valid_extensions = array(); + foreach (archiver_get_info() as $archive) { + foreach ($archive['extensions'] as $extension) { + foreach (explode('.', $extension) as $part) { + if (!in_array($part, $valid_extensions)) { + $valid_extensions[] = $part; + } + } + } + } + return implode(' ', $valid_extensions); +} + /** * Create the appropriate archiver for the specified file. * -- cgit v1.2.3