PrestaShopCorp / bpostshm

3 stars 5 forks source link

"exit" statement in install() method #6

Closed tchauviere closed 9 years ago

tchauviere commented 9 years ago

You cant use exit statement here: https://github.com/PrestaShop/bpostshm/blob/master/bpostshm.php#L124-125

It would lead to a blank page if merchant doesnt have curl on his server.

The good way is to do somehting like this:

 if (!extension_loaded(‘curl’))
{
    $this->_errors[] = $this->l('This module requires CURL to work properly');
    return false;
}

This way a merchant fallback on module page and an error message is displayed.

Stigmi commented 9 years ago

Thx for the remark, we added your code in the module.

tchauviere commented 9 years ago

Fixed!