Skip to content

Instantly share code, notes, and snippets.

@benallfree
Created December 21, 2013 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benallfree/8069845 to your computer and use it in GitHub Desktop.
Save benallfree/8069845 to your computer and use it in GitHub Desktop.
Zip files which do not contain a bare parent directory entry were not being detected correctly.
Index: modify-installer.php
===================================================================
--- modify-installer.php (revision 826618)
+++ modify-installer.php (working copy)
@@ -134,7 +134,7 @@
$contents = $archive->listContent();
foreach ( (array) $contents as $content ) {
- if ( preg_match( '|^([^/]+)/$|', $content['filename'], $matches ) ) {
+ if ( preg_match( '|^([^/]+)/|', $content['filename'], $matches ) ) {
$directory = $matches[1];
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment