Skip to content

Commit

Permalink
Issue #1712 #2044 - Plugin Download/Install from e107.org issue. Debu…
Browse files Browse the repository at this point in the history
…g data added and ampersand modified on URL.
  • Loading branch information
CaMer0n committed Nov 19, 2016
1 parent 5648f34 commit 70b8b6a
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions e107_admin/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,16 @@ function options($data)
//<button type='button' data-target='{$id}' data-loading='".e_IMAGE."/generic/loading_32.gif' class='btn btn-primary e-ajax middle' value='Download and Install' data-src='".$url."' ><span>Download and Install</span></button>
$modalCaption = (!empty($data['plugin_price'])) ? EPL_ADLAN_92." ".$data['plugin_name']." ".$data['plugin_version'] : EPL_ADLAN_230." ".$data['plugin_name']." ".$data['plugin_version'];

$url = e_SELF.'?mode=download&amp;src='.base64_encode($d);
$url = e_SELF.'?mode=download&src='.base64_encode($d);
$dicon = '<a title="'.EPL_ADLAN_237.'" class="e-modal btn btn-default" href="'.$url.'" rel="external" data-loading="'.e_IMAGE.'/generic/loading_32.gif" data-cache="false" data-modal-caption="'.$modalCaption.'" target="_blank" >'.ADMIN_INSTALLPLUGIN_ICON.'</a>';




// $base64 = base64_encode($d);
// $tmp = base64_decode($base64);
// parse_str($tmp, $data);

// e107::getDebug()->log($data); //FIXME - enable when needed to debug.

// Temporary Pop-up version.
// $dicon = '<a class="e-modal" href="'.$data['plugin_url'].'" rel="external" data-modal-caption="'.$data['plugin_name']." ".$data['plugin_version'].'" target="_blank" ><img class="top" src="'.e_IMAGE_ABS.'icons/download_32.png" alt="" /></a>';

Expand All @@ -670,6 +676,18 @@ private function pluginDownload()
$string = base64_decode($_GET['src']);
parse_str($string, $data);

if(e_DEBUG === true)
{
echo "<b>DEBUG MODE ACTIVE (no downloading)</b><br />";
echo '$_GET[src]: ';
print_a($_GET['src']);

echo 'base64 decoded and parsed as $data:';
print_a($data);
return false;
}


if(!empty($data['plugin_price']))
{
e107::getRedirect()->go($data['plugin_url']);
Expand Down

0 comments on commit 70b8b6a

Please sign in to comment.