Skip to content

Instantly share code, notes, and snippets.

@glye
Created January 16, 2018 13:07
Show Gist options
  • Save glye/35be88b346a03251198745285a4873f3 to your computer and use it in GitHub Desktop.
Save glye/35be88b346a03251198745285a4873f3 to your computer and use it in GitHub Desktop.
eZ package trim
Index: ezpublish_legacy/kernel/classes/ezpackage.php
===================================================================
--- ezpublish_legacy/kernel/classes/ezpackage.php (revision 70715)
+++ ezpublish_legacy/kernel/classes/ezpackage.php (working copy)
@@ -1137,7 +1137,7 @@
// Search for the files we want to extract
foreach( $archive as $entry )
{
- if ( in_array( $entry->getPath(), $fileList ) )
+ if ( in_array( trim($entry->getPath(),DIRECTORY_SEPARATOR), $fileList ) )
{
if ( !$archive->extractCurrent( $archivePath ) )
{
Index: vendor/zetacomponents/archive/src/entry.php
===================================================================
--- vendor/zetacomponents/archive/src/entry.php (revision 70715)
+++ vendor/zetacomponents/archive/src/entry.php (working copy)
@@ -212,11 +212,11 @@
{
if ( $withPrefix )
{
- return $this->fileStructure->path;
+ return trim($this->fileStructure->path);
}
else
{
- return $this->getPathWithoutPrefix( $this->fileStructure->path, $this->prefix );
+ return $this->getPathWithoutPrefix( trim($this->fileStructure->path), $this->prefix );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment