summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-07-29 02:27:43 +0000
committerDries Buytaert <dries@buytaert.net>2010-07-29 02:27:43 +0000
commit0de52de6468842f65076f6bbf944f75a86ba6595 (patch)
tree1ce72bd4759607febe1ddbe8ec22403fd8ec59c2 /includes
parentd2f7ddd8b88bb3010cac6e2b82a3b858eb97c7d9 (diff)
downloadbrdo-0de52de6468842f65076f6bbf944f75a86ba6595.tar.gz
brdo-0de52de6468842f65076f6bbf944f75a86ba6595.tar.bz2
- Patch #747252 by justinrandell, dhthwy, aspilicious: cannot extract themes and modules.
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc21
1 files changed, 21 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 725b20b68..9be957332 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -6778,6 +6778,27 @@ function archiver_get_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.
*
* @param $file