>DansTonCode();

Tous les codes sourcespage 59

PHP
 15 Juin, 2014 à 07:27
#212
// Who said that PrestaShop is easy to understand ?? Here are some snippets from some files.

$this->isLogged = (bool)((int)(self::$cookie->id_customer) AND Customer::customerIdExistsStatic((int)(self::$cookie->id_customer)));

// WTF ! controllers/cartController.php
(int)$producToAdd->out_of_stock == 2 ? !(int)Configuration::get(‘PS_ORDER_OUT_OF_STOCK’) : !(int)$producToAdd->out_of_stock;

// Why int cast before abs() ??? controllers/cartController.php
$qty = (int)(abs(Tools::getValue(‘qty’, 1)))

// Double cast ! modules/productcomments/productcomments-ajax.php
(bool)((int)Tools::getValue(‘value’));
PHP
 14 Juin, 2014 à 07:30
#181
$query = "SELECT * FROM myTable where name!='' and name!=NULL and isnull(name) !=1";