// Improve performance and bug fixes

This commit is contained in:
rGaillard
2012-06-06 16:22:48 +00:00
parent e636665621
commit 99b22fbbb8
32 changed files with 97 additions and 66 deletions
+4 -4
View File
@@ -1362,7 +1362,7 @@ class BlockLayered extends Module
$layered_filter_list = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT * FROM '._DB_PREFIX_.'layered_filter');
foreach ($layered_filter_list as $layered_filter)
{
$data = unserialize($layered_filter_list['filters']);
$data = Tools::unSerialize($layered_filter_list['filters']);
if (in_array((int)$params['category']->id, $data['categories']))
{
unset($data['categories'][array_search((int)$params['category']->id, $data['categories'])]);
@@ -2224,7 +2224,7 @@ class BlockLayered extends Module
{
$data = Db::getInstance()->getValue('SELECT data FROM `'._DB_PREFIX_.'layered_friendly_url` WHERE `url_key` = \''.md5('/'.$attribute_name.'-'.$url_parameter).'\'');
if ($data)
foreach (unserialize($data) as $key_params => $params)
foreach (Tools::unSerialize($data) as $key_params => $params)
{
if (!isset($selected_filters[$key_params]))
$selected_filters[$key_params] = array();
@@ -3457,7 +3457,7 @@ class BlockLayered extends Module
{
$layered_filter = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT * FROM '._DB_PREFIX_.'layered_filter WHERE id_layered_filter = '.(int)$id_layered_filter);
if ($layered_filter && isset($layered_filter['filters']) && !empty($layered_filter['filters']))
$layered_values = unserialize($layered_filter['filters']);
$layered_values = Tools::unSerialize($layered_filter['filters']);
if (isset($layered_values['categories']) && count($layered_values['categories']))
foreach ($layered_values['categories'] as $id_category)
$category_box[] = (int)$id_category;
@@ -4122,7 +4122,7 @@ class BlockLayered extends Module
$values = false;
foreach ($res as $filter_template)
{
$data = unserialize($filter_template['filters']);
$data = Tools::unSerialize($filter_template['filters']);
foreach ($data['categories'] as $id_category)
{
$n = 0;
+1 -1
View File
@@ -327,7 +327,7 @@ class BlockLink extends Module
<div class="clear"></div>
</div>
<label>'.$this->l('URL:').'</label>
<div class="margin-form"><input type="text" name="url" id="url" value="'.(isset($links) && isset($links['url']) ? $links['url'] : '').'" /><sup> *</sup></div>
<div class="margin-form"><input type="text" name="url" id="url" value="'.(isset($links) && isset($links['url']) ? Tools::safeOutput($links['url']) : '').'" /><sup> *</sup></div>
<label>'.$this->l('Open in a new window:').'</label>
<div class="margin-form"><input type="checkbox" name="newWindow" id="newWindow" '.((isset($links) && $links['new_window']) ? 'checked="checked"' : '').' /></div>';
$shops = Shop::getShops(true, null, true);
@@ -39,7 +39,7 @@
</ul>
{/if}
{if $form_list}
<form action="{$smarty.server.SCRIPT_NAME}" method="get">
<form action="{$smarty.server.SCRIPT_NAME|escape:'htmlall':'UTF-8'}" method="get">
<p>
<select id="manufacturer_list" onchange="autoUrl('manufacturer_list', '');">
<option value="0">{l s='All manufacturers' mod='blockmanufacturer'}</option>
@@ -34,7 +34,7 @@ class BlockPaymentLogo extends Module
{
$this->name = 'blockpaymentlogo';
$this->tab = 'front_office_features';
$this->version = 0.2;
$this->version = '0.2';
$this->author = 'PrestaShop';
$this->need_instance = 0;
+1 -1
View File
@@ -41,7 +41,7 @@
</ul>
{/if}
{if $form_list}
<form action="{$smarty.server.SCRIPT_NAME}" method="get">
<form action="{$smarty.server.SCRIPT_NAME|escape:'htmlall':'UTF-8'}" method="get">
<p>
<select id="supplier_list" onchange="autoUrl('supplier_list', '');">
<option value="0">{l s='All suppliers' mod='blocksupplier'}</option>
+1 -1
View File
@@ -10,7 +10,7 @@
<form id="searchbox" action="search.php" method="get">
<input type="hidden" value="position" name="orderby"/>
<input type="hidden" value="desc" name="orderway"/>
<input type="text" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query}{/if}" />
<input type="text" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|escape:'htmlall':'UTF-8'}{/if}" />
</form>
</li>
{/if}
@@ -164,7 +164,7 @@
<td class="history_date">{dateFormat date=$discount->date_to}</td>
<td class="history_method bold">{if $discount->quantity > 0}{l s='To use' mod='loyalty'}{else}{l s='Used' mod='loyalty'}{/if}</td>
<td class="history_method">
<a href="{$smarty.server.SCRIPT_NAME}" onclick="return false" class="tips" title="
<a href="{$smarty.server.SCRIPT_NAME|escape:'htmlall':'UTF-8'}" onclick="return false" class="tips" title="
{l s='Generated by these following orders' mod='loyalty'}|{foreach from=$discount->orders item=myorder name=myLoop}
{l s='Order #%d' sprintf=$myorder.id_order mod='loyalty'}
({displayPrice price=$myorder.total_paid currency=$myorder.id_currency}) :
@@ -110,9 +110,9 @@
{section name=friends start=0 loop=$nbFriends step=1}
<tr class="{if $smarty.section.friends.index % 2}item{else}alternate_item{/if}">
<td class="align_right">{$smarty.section.friends.iteration}</td>
<td><input type="text" class="text" name="friendsLastName[{$smarty.section.friends.index}]" size="14" value="{if isset($smarty.post.friendsLastName[$smarty.section.friends.index])}{$smarty.post.friendsLastName[$smarty.section.friends.index]}{/if}" /></td>
<td><input type="text" class="text" name="friendsFirstName[{$smarty.section.friends.index}]" size="14" value="{if isset($smarty.post.friendsFirstName[$smarty.section.friends.index])}{$smarty.post.friendsFirstName[$smarty.section.friends.index]}{/if}" /></td>
<td><input type="text" class="text" name="friendsEmail[{$smarty.section.friends.index}]" size="20" value="{if isset($smarty.post.friendsEmail[$smarty.section.friends.index])}{$smarty.post.friendsEmail[$smarty.section.friends.index]}{/if}" /></td>
<td><input type="text" class="text" name="friendsLastName[{$smarty.section.friends.index}]" size="14" value="{if isset($smarty.post.friendsLastName[$smarty.section.friends.index])}{$smarty.post.friendsLastName[$smarty.section.friends.index]|escape:'htmlall':'UTF-8'}{/if}" /></td>
<td><input type="text" class="text" name="friendsFirstName[{$smarty.section.friends.index}]" size="14" value="{if isset($smarty.post.friendsFirstName[$smarty.section.friends.index])}{$smarty.post.friendsFirstName[$smarty.section.friends.index]|escape:'htmlall':'UTF-8'}{/if}" /></td>
<td><input type="text" class="text" name="friendsEmail[{$smarty.section.friends.index}]" size="20" value="{if isset($smarty.post.friendsEmail[$smarty.section.friends.index])}{$smarty.post.friendsEmail[$smarty.section.friends.index]|escape:'htmlall':'UTF-8'}{/if}" /></td>
</tr>
{/section}
</tbody>
+2 -2
View File
@@ -435,7 +435,7 @@ class shopimporter extends ImportModule
if ((sizeof($rules['requiredLang']) || sizeof($rules['sizeLang']) || sizeof($rules['validateLang']) || Tools::isSubmit('syncLang') || Tools::isSubmit('syncCurrency')))
{
$moduleName = Tools::getValue('moduleName');
if (file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php'))
if (Validate::isModuleName($moduleName) && Validate::file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php'))
{
require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php');
$importModule = new $moduleName();
@@ -558,7 +558,7 @@ class shopimporter extends ImportModule
if ((sizeof($rules['requiredLang']) || sizeof($rules['sizeLang']) || sizeof($rules['validateLang']) || Tools::isSubmit('syncLangWS') || Tools::isSubmit('syncCurrency')))
{
$moduleName = Tools::getValue('moduleName');
if (file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php'))
if (Validate::isModuleName($moduleName) && file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php'))
{
require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php');