mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
#268 - Added cURL check to remote themes/plugins download
This commit is contained in:
@@ -456,6 +456,11 @@ class pluginManager{
|
|||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
// $mes->addWarning("Some older plugins may produce unpredictable results.");
|
// $mes->addWarning("Some older plugins may produce unpredictable results.");
|
||||||
|
// check for cURL
|
||||||
|
if(!function_exists(curl_init))
|
||||||
|
{
|
||||||
|
$mes->addWarning("cURL is currently required to use this feature. Contact your webhosting provider to enable cURL"); // TODO LAN?
|
||||||
|
}
|
||||||
|
|
||||||
$from = intval(varset($_GET['frm']));
|
$from = intval(varset($_GET['frm']));
|
||||||
$srch = preg_replace('/[^\w]/','', vartrue($_GET['srch']));
|
$srch = preg_replace('/[^\w]/','', vartrue($_GET['srch']));
|
||||||
|
@@ -323,11 +323,12 @@ class e_file
|
|||||||
*/
|
*/
|
||||||
function getRemoteFile($remote_url, $local_file, $type='temp')
|
function getRemoteFile($remote_url, $local_file, $type='temp')
|
||||||
{
|
{
|
||||||
|
// check for cURL
|
||||||
if (!function_exists('curl_init'))
|
if (!function_exists('curl_init'))
|
||||||
{
|
{
|
||||||
if(E107_DEBUG_LEVEL > 0)
|
if(E107_DEBUG_LEVEL > 0)
|
||||||
{
|
{
|
||||||
e107::getAdminLog()->addDebug('getRemoteFile() requires CURL to be installed in file_class.php');
|
e107::getAdminLog()->addDebug('getRemoteFile() requires cURL to be installed in file_class.php')
|
||||||
}
|
}
|
||||||
return FALSE; // May not be installed
|
return FALSE; // May not be installed
|
||||||
}
|
}
|
||||||
|
@@ -455,6 +455,12 @@ class themeHandler
|
|||||||
$limit = 96;
|
$limit = 96;
|
||||||
$srch = preg_replace('/[^\w]/','', vartrue($_GET['srch']));
|
$srch = preg_replace('/[^\w]/','', vartrue($_GET['srch']));
|
||||||
|
|
||||||
|
// check for cURL
|
||||||
|
if(!function_exists(curl_init))
|
||||||
|
{
|
||||||
|
$mes->addWarning("cURL is currently required to use this feature. Contact your webhosting provider to enable cURL"); // TODO LAN?
|
||||||
|
}
|
||||||
|
|
||||||
$file = "http://e107.org/feed?type=theme&frm=".$from."&srch=".$srch."&limit=".$limit;
|
$file = "http://e107.org/feed?type=theme&frm=".$from."&srch=".$srch."&limit=".$limit;
|
||||||
|
|
||||||
$mes->addDebug("File = ".$file);
|
$mes->addDebug("File = ".$file);
|
||||||
@@ -603,7 +609,7 @@ class themeHandler
|
|||||||
|
|
||||||
$text .= "</form>";
|
$text .= "</form>";
|
||||||
|
|
||||||
$ns->tablerender(TPVLAN_26.SEP."Available for Download", $text. $mes->render());
|
$ns->tablerender(TPVLAN_26.SEP."Available for Download", $mes->render().$text);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -957,7 +963,6 @@ class themeHandler
|
|||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
|
|
||||||
|
|
||||||
$author = ($theme['email'] ? "<a href='mailto:".$theme['email']."' title='".$theme['email']."'>".$theme['author']."</a>" : $theme['author']);
|
$author = ($theme['email'] ? "<a href='mailto:".$theme['email']."' title='".$theme['email']."'>".$theme['author']."</a>" : $theme['author']);
|
||||||
$website = ($theme['website'] ? "<a href='".$theme['website']."' rel='external'>".$theme['website']."</a>" : "");
|
$website = ($theme['website'] ? "<a href='".$theme['website']."' rel='external'>".$theme['website']."</a>" : "");
|
||||||
// $preview = "<a href='".e_BASE."news.php?themepreview.".$theme['id']."' title='".TPVLAN_9."' >".($theme['preview'] ? "<img src='".$theme['preview']."' style='border: 1px solid #000;width:200px' alt='' />" : "<img src='".e_IMAGE_ABS."admin_images/nopreview.png' title='".TPVLAN_12."' alt='' />")."</a>";
|
// $preview = "<a href='".e_BASE."news.php?themepreview.".$theme['id']."' title='".TPVLAN_9."' >".($theme['preview'] ? "<img src='".$theme['preview']."' style='border: 1px solid #000;width:200px' alt='' />" : "<img src='".e_IMAGE_ABS."admin_images/nopreview.png' title='".TPVLAN_12."' alt='' />")."</a>";
|
||||||
|
Reference in New Issue
Block a user