summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2011-01-28 07:20:50 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2011-01-28 07:20:50 +0000
commitc481e81e8acd446da21883d10b980aecf9e331ba (patch)
tree348a041cbfb30799fc4754dbd41f095c56a93bec /modules
parent7ef653107207f4b7b3da6c9f41908fffe8cec884 (diff)
downloadbrdo-c481e81e8acd446da21883d10b980aecf9e331ba.tar.gz
brdo-c481e81e8acd446da21883d10b980aecf9e331ba.tar.bz2
#1019834 by bfroehle: Fixed No .info files reported on theme upload when zip created with certain programs
Diffstat (limited to 'modules')
-rw-r--r--modules/update/update.manager.inc15
1 files changed, 11 insertions, 4 deletions
diff --git a/modules/update/update.manager.inc b/modules/update/update.manager.inc
index 4f55b1b5b..5bb12c4a4 100644
--- a/modules/update/update.manager.inc
+++ b/modules/update/update.manager.inc
@@ -644,8 +644,11 @@ function update_manager_install_form_submit($form, &$form_state) {
form_set_error($field, t('Provided archive contains no files.'));
return;
}
- // Unfortunately, we can only use the directory name for this. :(
- $project = drupal_substr($files[0], 0, -1);
+
+ // Unfortunately, we can only use the directory name to determine the project
+ // name. Some archivers list the first file as the directory (i.e., MODULE/)
+ // and others list an actual file (i.e., MODULE/README.TXT).
+ $project = strtok($files[0], '/\\');
$archive_errors = update_manager_archive_verify($project, $local_cache, $directory);
if (!empty($archive_errors)) {
@@ -771,8 +774,12 @@ function update_manager_archive_extract($file, $directory) {
// old files mixed with the new files (e.g. in cases where files were removed
// from a later release).
$files = $archiver->listContents();
- // Unfortunately, we can only use the directory name for this. :(
- $project = drupal_substr($files[0], 0, -1);
+
+ // Unfortunately, we can only use the directory name to determine the project
+ // name. Some archivers list the first file as the directory (i.e., MODULE/)
+ // and others list an actual file (i.e., MODULE/README.TXT).
+ $project = strtok($files[0], '/\\');
+
$extract_location = $directory . '/' . $project;
if (file_exists($extract_location)) {
file_unmanaged_delete_recursive($extract_location);