mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Fix for detection of theme/plugin root directory in .zip
This commit is contained in:
@@ -700,7 +700,7 @@ class pluginManager{
|
||||
$string = base64_decode($_GET['src']);
|
||||
parse_str($string, $data);
|
||||
|
||||
if(e_DEBUG === true)
|
||||
if(deftrue('e_DEBUG_MARKETPLACE'))
|
||||
{
|
||||
echo "<b>DEBUG MODE ACTIVE (no downloading)</b><br />";
|
||||
echo '$_GET[src]: ';
|
||||
|
@@ -165,7 +165,7 @@ if($mode == 'download' && !empty($_GET['src']))
|
||||
return true;
|
||||
}
|
||||
|
||||
if(e_DEBUG === true)
|
||||
if(deftrue('e_DEBUG_MARKETPLACE'))
|
||||
{
|
||||
echo "<b>DEBUG MODE ACTIVE (no downloading)</b><br />";
|
||||
echo '$_GET: ';
|
||||
|
@@ -1338,6 +1338,7 @@ class e_file
|
||||
for($i = 0; $i < $zip->numFiles; $i++ )
|
||||
{
|
||||
$filename = $zip->getNameIndex($i);
|
||||
|
||||
$fileinfo = pathinfo($filename);
|
||||
|
||||
if($fileinfo['dirname'] === '.')
|
||||
@@ -1345,6 +1346,10 @@ class e_file
|
||||
$dir = $fileinfo['basename'];
|
||||
break;
|
||||
}
|
||||
elseif($fileinfo['basename'] === 'plugin.php' || $fileinfo['basename'] === 'theme.php')
|
||||
{
|
||||
$dir = $fileinfo['dirname'];
|
||||
}
|
||||
|
||||
// $stat = $zip->statIndex( $i );
|
||||
// print_a( $stat['name'] );
|
||||
@@ -1354,10 +1359,18 @@ class e_file
|
||||
$zip->extractTo(e_TEMP);
|
||||
chmod(e_TEMP.$dir, 0755);
|
||||
|
||||
if(empty($dir) && e_DEBUG)
|
||||
{
|
||||
print_a($fileinfo);
|
||||
}
|
||||
|
||||
|
||||
$zip->close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else // Legacy Method.
|
||||
{
|
||||
|
Reference in New Issue
Block a user