// Change URLs calling for prestashop.com

This commit is contained in:
rGaillard
2011-11-25 18:45:07 +00:00
parent 11a5e1560e
commit f82dbee84d
18 changed files with 42 additions and 42 deletions
+6 -6
View File
@@ -670,13 +670,13 @@ if (Tools::isSubmit('getAdminHomeElement'))
$stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => 5)));
// SCREENCAST
if (@fsockopen('www.prestashop.com', 80, $errno, $errst, 3))
if (@fsockopen('api.prestashop.com', 80, $errno, $errst, 3))
$result['screencast'] = 'OK';
else
$result['screencast'] = 'NOK';
// PREACTIVATION
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
$content = @file_get_contents($protocol.'://api.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
if (!$content)
$result['partner_preactivation'] = 'NOK';
else
@@ -702,7 +702,7 @@ if (Tools::isSubmit('getAdminHomeElement'))
}
// PREACTIVATION PAYPAL WARNING
$content = @file_get_contents('https://www.prestashop.com/partner/preactivation/preactivation-warnings.php?version=1.0&partner=paypal&iso_country='.Tools::strtolower(Context::getContext()->country->iso_code).'&iso_lang='.Tools::strtolower(Context::getContext()->language->iso_code).'&id_lang='.(int)Context::getContext()->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
$content = @file_get_contents('https://api.prestashop.com/partner/preactivation/preactivation-warnings.php?version=1.0&partner=paypal&iso_country='.Tools::strtolower(Context::getContext()->country->iso_code).'&iso_lang='.Tools::strtolower(Context::getContext()->language->iso_code).'&id_lang='.(int)Context::getContext()->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
$content = explode('|', $content);
if ($content[0] == 'OK' && Validate::isCleanHtml($content[1]))
Configuration::updateValue('PS_PREACTIVATION_PAYPAL_WARNING', $content[1]);
@@ -710,7 +710,7 @@ if (Tools::isSubmit('getAdminHomeElement'))
Configuration::updateValue('PS_PREACTIVATION_PAYPAL_WARNING', '');
// DISCOVER PRESTASHOP
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
$content = @file_get_contents($protocol.'://api.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
if (!$content)
$result['discover_prestashop'] = 'NOK';
else
@@ -722,9 +722,9 @@ if (Tools::isSubmit('getAdminHomeElement'))
$result['discover_prestashop'] = 'NOK';
if (@fsockopen('www.prestashop.com', 80, $errno, $errst, 3))
$result['discover_prestashop'] .= '<iframe frameborder="no" style="margin: 0px; padding: 0px; width: 315px; height: 290px;" src="'.$protocol.'://www.prestashop.com/rss/news2.php?v='._PS_VERSION_.'&lang='.$isoUser.'"></iframe>';
$result['discover_prestashop'] .= '<iframe frameborder="no" style="margin: 0px; padding: 0px; width: 315px; height: 290px;" src="'.$protocol.'://api.prestashop.com/rss/news2.php?v='._PS_VERSION_.'&lang='.$isoUser.'"></iframe>';
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
$content = @file_get_contents($protocol.'://api.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
$content = explode('|', $content);
if ($content[0] == 'OK' && Validate::isCleanHtml($content[1]))
$result['discover_prestashop'] .= $content[1];
+2 -2
View File
@@ -34,10 +34,10 @@ if(!isset($_GET['iso_lang']) OR empty($_GET['iso_lang']))
die('fail:0');
if(!isset($_GET['ps_version']) OR empty($_GET['ps_version']))
die('fail:0');
if(@fsockopen('www.prestashop.com', 80))
if(@fsockopen('api.prestashop.com', 80))
{
// 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']);
$lang_packs = Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/get_language_pack.php?version='.(string)$_GET['ps_version'].'&iso_lang='.(string)$_GET['iso_lang']);
if ($lang_packs !== '' && Tools::jsonDecode($lang_packs) !== NULL)
{
+1 -1
View File
@@ -340,7 +340,7 @@ class CurrencyCore extends ObjectModel
public static function refreshCurrencies()
{
// Parse
if (!$feed = Tools::simplexml_load_file('http://www.prestashop.com/xml/currencies.xml'))
if (!$feed = Tools::simplexml_load_file('http://api.prestashop.com/xml/currencies.xml'))
return Tools::displayError('Cannot parse feed.');
// Default feed currency (EUR)
+1 -1
View File
@@ -77,7 +77,7 @@ abstract class ImportModuleCore extends Module
return array_shift($result[0]);
}
public static function getImportModulesOnDisk ()
public static function getImportModulesOnDisk()
{
$modules = Module::getModulesOnDisk(true);
foreach ($modules as $key => $module)
+3 -3
View File
@@ -641,13 +641,13 @@ class LanguageCore extends ObjectModel
return true;
else
{
if(@fsockopen('www.prestashop.com', 80))
if(@fsockopen('api.prestashop.com', 80))
{
$lang = new Language();
$lang->iso_code = $iso_code;
$lang->active = true;
if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code)))
if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code)))
{
if (isset($lang_pack->name)
&& isset($lang_pack->version)
@@ -660,7 +660,7 @@ class LanguageCore extends ObjectModel
if ($lang_pack)
{
$flag = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg');
$flag = Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg');
if ($flag != NULL && !preg_match('/<body>/', $flag))
{
$file = fopen(dirname(__FILE__).'/../img/l/'.$insert_id.'.jpg', 'w');
+4 -4
View File
@@ -238,7 +238,7 @@ class LocalizationPackCore
{
if (isset($xml->currencies->currency))
{
if (!$feed = Tools::simplexml_load_file('http://www.prestashop.com/xml/currencies.xml') AND !$feed = @simplexml_load_file(dirname(__FILE__).'/../localization/currencies.xml'))
if (!$feed = Tools::simplexml_load_file('http://api.prestashop.com/xml/currencies.xml') AND !$feed = @simplexml_load_file(dirname(__FILE__).'/../localization/currencies.xml'))
{
$this->_errors[] = Tools::displayError('Cannot parse the currencies XML feed.');
return false;
@@ -301,11 +301,11 @@ class LocalizationPackCore
if ((in_array((string)$attributes['iso_code'], $native_iso_code) AND !$install_mode) OR !in_array((string)$attributes['iso_code'], $native_iso_code))
$errno = 0;
$errstr = '';
if(@fsockopen('www.prestashop.com', 80, $errno, $errstr, 10))
if(@fsockopen('api.prestashop.com', 80, $errno, $errstr, 10))
{
if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$attributes['iso_code'])))
if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$attributes['iso_code'])))
{
if ($content = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$attributes['iso_code'].'.gzip'))
if ($content = Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$attributes['iso_code'].'.gzip'))
{
$file = _PS_TRANSLATIONS_DIR_.$attributes['iso_code'].'.gzip';
if (file_put_contents($file, $content))
+2 -2
View File
@@ -28,8 +28,8 @@
class UpgraderCore
{
const DEFAULT_CHECK_VERSION_DELAY_HOURS = 24;
public $rss_version_link = 'http://www.prestashop.com/xml/upgrader.xml';
public $rss_md5file_link_dir = 'http://www.prestashop.com/xml/md5/';
public $rss_version_link = 'http://api.prestashop.com/xml/upgrader.xml';
public $rss_md5file_link_dir = 'http://api.prestashop.com/xml/md5/';
/**
* @var boolean contains true if last version is not installed
*/
+4 -4
View File
@@ -437,13 +437,13 @@ class AdminHomeControllerCore extends AdminController
if (@fsockopen('www.prestashop.com', 80, $errno, $errst, AdminHomeController::TIPS_TIMEOUT))
$result['discover_prestashop'] .= '<iframe frameborder="no" style="margin: 0px; padding: 0px; width: 315px; height: 290px;" src="'.$protocol.'://www.prestashop.com/rss/news2.php?v='._PS_VERSION_.'&lang='.$isoUser.'"></iframe>';
$result['discover_prestashop'] .= '<iframe frameborder="no" style="margin: 0px; padding: 0px; width: 315px; height: 290px;" src="'.$protocol.'://api.prestashop.com/rss/news2.php?v='._PS_VERSION_.'&lang='.$isoUser.'"></iframe>';
else
$result['discover_prestashop'] .= '';
// SHOW PAYPAL TIPS
$content = '';
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
$content = @file_get_contents($protocol.'://api.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
$content = explode('|', $content);
if ($content[0] == 'OK' && Validate::isCleanHtml($content[1]))
$result['discover_prestashop'] .= $content[1];
@@ -468,7 +468,7 @@ class AdminHomeControllerCore extends AdminController
public function getBlockPartners()
{
$stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => AdminHomeController::TIPS_TIMEOUT)));
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
$content = @file_get_contents($protocol.'://api.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
if (!$content)
$return = ''; // NOK
else
@@ -504,7 +504,7 @@ class AdminHomeControllerCore extends AdminController
$isoUser = Context::getContext()->language->iso_code;
$isoCountry = Context::getContext()->country->iso_code;
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
$content = @file_get_contents($protocol.'://api.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
if (!$content)
return ''; // NOK
else
@@ -99,7 +99,7 @@ class AdminLocalizationControllerCore extends AdminController
{
if (Tools::isSubmit('submitLocalizationPack'))
{
if (!$pack = @Tools::file_get_contents('http://www.prestashop.com/download/localization/'.Tools::getValue('iso_localization_pack').'.xml') &&
if (!$pack = @Tools::file_get_contents('http://api.prestashop.com/download/localization/'.Tools::getValue('iso_localization_pack').'.xml') &&
!$pack = @Tools::file_get_contents(dirname(__FILE__).'/../../localization/'.Tools::getValue('iso_localization_pack').'.xml'))
$this->_errors[] = Tools::displayError('Cannot load localization pack (from prestashop.com and from your local folder "localization")');
else if (!$selection = Tools::getValue('selection'))
@@ -128,7 +128,7 @@ class AdminLocalizationControllerCore extends AdminController
$localizations_pack = false;
$this->tpl_option_vars['options_content'] = $this->initOptions();
$xml_localization = Tools::simplexml_load_file('http://www.prestashop.com/rss/localization.xml');
$xml_localization = Tools::simplexml_load_file('http://api.prestashop.com/rss/localization.xml');
if (!$xml_localization)
{
$localization_file = dirname(__FILE__).'/../../localization/localization.xml';
@@ -31,7 +31,7 @@ define ('TEXTAREA_SIZED', 70);
class AdminTranslationsControllerCore extends AdminController
{
protected $link_lang_pack = 'http://www.prestashop.com/download/lang_packs/get_each_language_pack.php';
protected $link_lang_pack = 'http://api.prestashop.com/download/lang_packs/get_each_language_pack.php';
protected $total_expression = 0;
protected $all_iso_lang = array();
protected $modules_translations = array();
@@ -312,7 +312,7 @@ class AdminTranslationsControllerCore extends AdminController
if (Validate::isLangIsoCode($arr_import_lang[0]))
{
if ($content = Tools::file_get_contents(
'http://www.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.$arr_import_lang[0].'.gzip', false,
'http://api.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.$arr_import_lang[0].'.gzip', false,
@stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 5)))))
{
$file = _PS_TRANSLATIONS_DIR_.$arr_import_lang[0].'.gzip';
+3 -3
View File
@@ -572,13 +572,13 @@ class Language extends ObjectModel
return true;
else
{
if(@fsockopen('www.prestashop.com', 80))
if(@fsockopen('api.prestashop.com', 80))
{
$lang = new Language();
$lang->iso_code = $iso_code;
$lang->active = true;
if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code)))
if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code)))
{
if (isset($lang_pack->name)
&& isset($lang_pack->version)
@@ -591,7 +591,7 @@ class Language extends ObjectModel
if ($lang_pack)
{
$flag = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg');
$flag = Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg');
if ($flag != NULL && !preg_match('/<body>/', $flag))
{
$file = fopen(dirname(__FILE__).'/../img/l/'.$insert_id.'.jpg', 'w');
+2 -2
View File
@@ -780,7 +780,7 @@ if ($lm->getIncludeTradFilename())
}
$stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => 3)));
$content = @file_get_contents('http://www.prestashop.com/partner/preactivation/partners.php?version=1.0', false, $stream_context);
$content = @file_get_contents('http://api.prestashop.com/partner/preactivation/partners.php?version=1.0', false, $stream_context);
if ($content && $content[0] == '<')
{
$result = simplexml_load_string($content);
@@ -1316,7 +1316,7 @@ if ($lm->getIncludeTradFilename())
<?php
if (@fsockopen('www.prestashop.com', 80, $errno, $errst, 3))
if (@fsockopen('features.prestashop.com', 80, $errno, $errst, 3))
{
echo '
<h2>'.lang('New features in PrestaShop v').INSTALL_VERSION.'</h2>
+2 -2
View File
@@ -18,7 +18,7 @@
$c = addslashes(strtolower($_GET['country_iso_code']));
$stream_context = @stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
$content = @file_get_contents('http://www.prestashop.com/partner/preactivation/fields.php?version=1.0&partner='.$p.'&country_iso_code='.$c, false, $stream_context);
$content = @file_get_contents('http://api.prestashop.com/partner/preactivation/fields.php?version=1.0&partner='.$p.'&country_iso_code='.$c, false, $stream_context);
if ($content && $content[0] == '<')
{
@@ -103,7 +103,7 @@
if ($_GET['request'] == 'send')
{
$stream_context = @stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
$url = 'http://www.prestashop.com/partner/preactivation/actions.php?version=1.0&partner='.addslashes($_GET['partner']);
$url = 'http://api.prestashop.com/partner/preactivation/actions.php?version=1.0&partner='.addslashes($_GET['partner']);
// Protect fields
foreach ($_GET as $key => $value)
+1 -1
View File
@@ -210,7 +210,7 @@ if (isFormValid())
$stream_context = @stream_context_create(array('http' => array('timeout' => 5)));
$localization_file = @Tools::file_get_contents('http://www.prestashop.com/download/localization_pack.php?country='.$_GET['countryName'], false, $stream_context);
$localization_file = @Tools::file_get_contents('http://api.prestashop.com/download/localization_pack.php?country='.$_GET['countryName'], false, $stream_context);
if (!$localization_file AND file_exists(dirname(__FILE__).'/../../localization/'.strtolower($_GET['countryName']).'.xml'))
$localization_file = @file_get_contents(dirname(__FILE__).'/../../localization/'.strtolower($_GET['countryName']).'.xml');
if ($localization_file)
+2 -2
View File
@@ -237,7 +237,7 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
// Load partners XML file from prestashop.com
$stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => 3)));
$content = @file_get_contents('http://www.prestashop.com/partner/preactivation/partners.php?version=1.1', false, $stream_context);
$content = @file_get_contents('http://api.prestashop.com/partner/preactivation/partners.php?version=1.1', false, $stream_context);
if (!$xml = @simplexml_load_string($content))
$this->ajaxJsonAnswer(false, $this->l('Cannot load partners from PrestaShop website'));
@@ -305,7 +305,7 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
{
// Load partners fields XML file from prestashop.com
$stream_context = @stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 5)));
$content = @file_get_contents('http://www.prestashop.com/partner/preactivation/fields.php?version=1.1&partner='.$partner_id.'&country_iso_code='.$iso, false, $stream_context);
$content = @file_get_contents('http://api.prestashop.com/partner/preactivation/fields.php?version=1.1&partner='.$partner_id.'&country_iso_code='.$iso, false, $stream_context);
if (!$xml = @simplexml_load_string($content))
$this->ajaxJsonAnswer(false, $this->l('Cannot load partners fields from PrestaShop website'));
+1 -1
View File
@@ -185,7 +185,7 @@ class InstallControllerHttpProcess extends InstallControllerHttp
foreach ($this->session->partners as $partner => $data)
{
/*$stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => 5)));
$url = 'http://www.prestashop.com/partner/preactivation/actions.php?version=1.0&partner='.addslashes($_GET['partner']);
$url = 'http://api.prestashop.com/partner/preactivation/actions.php?version=1.0&partner='.addslashes($_GET['partner']);
// Protect fields
foreach ($_GET as $key => $value)
+3 -3
View File
@@ -572,13 +572,13 @@ class Language extends ObjectModel
return true;
else
{
if(@fsockopen('www.prestashop.com', 80))
if(@fsockopen('api.prestashop.com', 80))
{
$lang = new Language();
$lang->iso_code = $iso_code;
$lang->active = true;
if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code)))
if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code)))
{
if (isset($lang_pack->name)
&& isset($lang_pack->version)
@@ -591,7 +591,7 @@ class Language extends ObjectModel
if ($lang_pack)
{
$flag = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg');
$flag = Tools::file_get_contents('http://api.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg');
if ($flag != NULL && !preg_match('/<body>/', $flag))
{
$file = fopen(dirname(__FILE__).'/../img/l/'.$insert_id.'.jpg', 'w');
+1 -1
View File
@@ -210,7 +210,7 @@ if (isFormValid())
$stream_context = @stream_context_create(array('http' => array('timeout' => 5)));
$localization_file = @Tools::file_get_contents('http://www.prestashop.com/download/localization_pack.php?country='.$_GET['countryName'], false, $stream_context);
$localization_file = @Tools::file_get_contents('http://api.prestashop.com/download/localization_pack.php?country='.$_GET['countryName'], false, $stream_context);
if (!$localization_file AND file_exists(dirname(__FILE__).'/../../localization/'.strtolower($_GET['countryName']).'.xml'))
$localization_file = @file_get_contents(dirname(__FILE__).'/../../localization/'.strtolower($_GET['countryName']).'.xml');
if ($localization_file)