Jump to content

IMPORTANT: Apply security fixes to third-party themes


Recommended Posts

I've noticed that a lot of third-party themes are missing the security fixes that were added to PrestaShop v1.3.1. If you are using PrestaShop v1.3.1 or later and are using a third-party theme, make sure that your theme includes the security fixes. If necessary, change line 8 of errors.tpl in your theme from:

{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'}



to:

{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}



and line 274 of shopping-cart.tpl from:

{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'}



to:

{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}



If you are using a version of PrestaShop before v1.3.1, you'll need to apply the rest of the fixes here, otherwise you'll get an error that the secureReferrer function doesn't exist.

Message for Theme Creators

Theme creators should create two separate themes for PrestaShop v1.2.5 and PrestaShop v1.3, instead of just writing that their theme is "compatible with PrestaShop v1.3" without making any changes to the PrestaShop v1.2.5 theme. Although PrestaShop v1.2.5 themes do work in PrestaShop v1.3 without any modifications, they are missing the security fix. At the very least, theme creators should apply the security fix above to their theme, though ideally, they should recreate their theme using the default PrestaShop v1.3.1 theme to include all bug fixes made to the theme.

When posting your theme on the forums, please write which version of the default PrestaShop theme your theme was based on. For example, if your theme was based on the default PrestaShop v1.2.5 theme, you should write:

Designed for PrestaShop v1.2.5
Compatible with PrestaShop v1.2.5

Only if you've created a version of your theme that includes the security fix, add that it is compatible with v1.3.1:

Designed for PrestaShop v1.2.5
Compatible with PrestaShop v1.2.5 and v1.3.1

When you've created a theme based on the PrestaShop v1.3.1 theme, write the following on your post:

Designed for PrestaShop v1.3.1
Compatible with PrestaShop v1.3.1

Writing which version of PrestaShop the theme was designed for and which versions of PrestaShop it is compatible with will make it clear for theme users exactly what they are getting when they download the theme.

Link to comment
Share on other sites

  • 2 weeks later...

Worse, i couldn't find the second one on the line 272 in shopping-cart.tpl because the codes end at the line 205 :(
There's no code further than the line 205.


Any hint? Something is wrong with it?

Thank you as always :)

very sorry for messing the thread. but my first post was trimmed.

Link to comment
Share on other sites

Can you post link to your site or upload in zip file shopping-cart.tpl ?

Edit : change in line 203

{else}{$smarty.server.HTTP_REFERER}{/if}


to

{else}{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}{/if}

Link to comment
Share on other sites

Hi,
thanks a lot for the reply. I've attached the shopping-cart.tpl
i download the theme from here: http://ezytrader.com/product.php?id_product=41

Your suggestions are highly appreciated :)
many thanks

p.s. rocky said the first one should be found at the line 8 of error.tpl, but in this theme, it's on the line 9. do you think it's Ok? it's also missing the word ''escape'' from the code snippet.

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...

HI im using black and white theme by 2link, and when i check with error.tpl, it seems there are lacking codes compared to yours.

{if isset($errors) && $errors}


{if $errors|@count > 1}{l s='There are'}{else}{l s='There is'}{/if} {$errors|@count} {if $errors|@count > 1}{l s='errors'}{else}{l s='error'}{/if} :

       {foreach from=$errors key=k item=error}
{$error}
       {/foreach}


<a href="{$smarty.server.HTTP_REFERER}" class="button_small" title="{l s='Back'}">« {l s='Back'}

{/if}



this is the code i have. is this ok? or i still have to change something?

Link to comment
Share on other sites

Yes, you are missing code. The following line:


<a href="{$smarty.server.HTTP_REFERER}" class="button_small" title="{l s='Back'}">« {l s='Back'}



should be:


<a href="{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}" class="button_small" title="{l s='Back'}">« {l s='Back'}

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...
  • 4 weeks later...
  • 2 weeks later...
  • 5 months later...
  • 3 weeks later...
  • 3 months later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...