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