// Remove unnecessary fsockopen
This commit is contained in:
@@ -480,10 +480,8 @@ class AdminHomeControllerCore extends AdminController
|
|||||||
$stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => 2)));
|
$stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => 2)));
|
||||||
|
|
||||||
// SCREENCAST
|
// SCREENCAST
|
||||||
if (@fsockopen('screencasts.prestashop.com', 80, $errno, $errst, AdminHomeController::TIPS_TIMEOUT))
|
$result['screencast'] = 'OK';
|
||||||
$result['screencast'] = 'OK';
|
|
||||||
else
|
|
||||||
$result['screencast'] = 'NOK';
|
|
||||||
|
|
||||||
// PREACTIVATION
|
// PREACTIVATION
|
||||||
$result['partner_preactivation'] = $this->getBlockPartners();
|
$result['partner_preactivation'] = $this->getBlockPartners();
|
||||||
@@ -491,8 +489,7 @@ class AdminHomeControllerCore extends AdminController
|
|||||||
// DISCOVER PRESTASHOP
|
// DISCOVER PRESTASHOP
|
||||||
$result['discover_prestashop'] = '<div id="block_tips">'.$this->getBlockDiscover().'</div>';
|
$result['discover_prestashop'] = '<div id="block_tips">'.$this->getBlockDiscover().'</div>';
|
||||||
|
|
||||||
if (@fsockopen('api.prestashop.com', 80, $errno, $errst, AdminHomeController::TIPS_TIMEOUT))
|
$result['discover_prestashop'] .= '<div class="row-news"><div id="block_discover"><iframe frameborder="no" style="margin: 0px; padding: 0px; width: 100%; height:300px; overflow:hidden;" src="'.$protocol.'://api.prestashop.com/rss2/news2.php?v='._PS_VERSION_.'&lang='.$isoUser.'"></iframe></div>';
|
||||||
$result['discover_prestashop'] .= '<div class="row-news"><div id="block_discover"><iframe frameborder="no" style="margin: 0px; padding: 0px; width: 100%; height:300px; overflow:hidden;" src="'.$protocol.'://api.prestashop.com/rss2/news2.php?v='._PS_VERSION_.'&lang='.$isoUser.'"></iframe></div>';
|
|
||||||
|
|
||||||
// SHOW TIPS OF THE DAY
|
// SHOW TIPS OF THE DAY
|
||||||
$content = @file_get_contents($protocol.'://api.prestashop.com/partner/tipsoftheday/?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser), false, $stream_context);
|
$content = @file_get_contents($protocol.'://api.prestashop.com/partner/tipsoftheday/?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser), false, $stream_context);
|
||||||
|
|||||||
@@ -485,10 +485,10 @@ class AdminLanguagesControllerCore extends AdminController
|
|||||||
$this->status = 'error';
|
$this->status = 'error';
|
||||||
$this->errors[] = '[TECHNICAL ERROR] ps_version not set or empty';
|
$this->errors[] = '[TECHNICAL ERROR] ps_version not set or empty';
|
||||||
}
|
}
|
||||||
if (@fsockopen('www.prestashop.com', 80))
|
|
||||||
|
// Get all iso code available
|
||||||
|
if($lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.(string)$_GET['ps_version'].'&iso_lang='.(string)$_GET['iso_lang']))
|
||||||
{
|
{
|
||||||
// Get all iso code available
|
|
||||||
$lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.(string)$_GET['ps_version'].'&iso_lang='.(string)$_GET['iso_lang']);
|
|
||||||
$result = Tools::jsonDecode($lang_packs);
|
$result = Tools::jsonDecode($lang_packs);
|
||||||
if ($lang_packs !== '' && $result && !isset($result->error))
|
if ($lang_packs !== '' && $result && !isset($result->error))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user