Jump to content

[SOLVED] HTTPS Unsecure items noticed when front blocks are active, prestashop version 1.4.0.4


Martin C

Recommended Posts

Hi all,

I am playing with 1.4.0.4 and installed it locally to testdrive this version.
I noticed that a lot of the frontblocks (new products,viewed product block etc.) always generate an unsecure items notice when you are in https mode.
This also happend with the order.php the product images in the cart will generate unsecure notice!

Is this normal behaviour? or should you exclude this modules for login.php/ account.php etc.

Regards, Martin

Link to comment
Share on other sites

I investigate further and in mine opinion it is the function getImageLink in the class link.php which is not ssl compliant.

public function getImageLink($name, $ids, $type = NULL)
   {
       global $protocol;
       if ($this->allow == 1)
           $uri_path = __PS_BASE_URI__.$ids.($type ? '-'.$type : '').'/'.$name.'.jpg';
       else
           $uri_path = _THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').'.jpg';
       return $protocol.Tools::getMediaServer($uri_path).$uri_path;
   }

Link to comment
Share on other sites

Okay i fixed this small issue:

Change the code around row 139 to:

    public function getImageLink($name, $ids, $type = NULL)
   {
       global $protocol_ssl;
       if ($this->allow == 1)
           $uri_path = __PS_BASE_URI__.$ids.($type ? '-'.$type : '').'/'.$name.'.jpg';
       else
           $uri_path = _THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').'.jpg';
       return $protocol_ssl.Tools::getMediaServer($uri_path).$uri_path;
   }



All the images which use the getimagelink function are now displayed via HTTPS.

Link to comment
Share on other sites

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...