Home

Recent Activity

Magento has just released the SUPEE-10415 security patch for the following versions:

  • Magento Commerce 1.9.0.0-1.14.3.7 (formerly known as Enterprise Edition)
  • Magento Open Source 1.5.0.0-1.9.3.7 (formerly known as Community Edition)

The patch contains fixed for several security vulnerabilities including cross-site request forgery (CSRF), Denial-of-Service (DoS), and authenticated Admin user remote code execution (RCE).

 

I recently came across this really helpful PHP trick:

You can cast a numeric string to either int or float, depending on its contents, by simply adding 0:

var_dump("1" + 0);
// int(1)

var_dump("1." + 0);
// float(1)

var_dump("1.0" + 0);
// float(1)

var_dump("1.5" + 0);
// float(1.5)

That's much cleaner than trying to make a conditional cast yourself: