Blog

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:

 

I recently needed the ability to perform a RIGHT JOIN in a Symfony project. While Doctrine's DBAL library seems to support this, the ORM's QueryBuilder does not. Unfortunately, the suggested workaround of inverting the query wouldn't work in my situation. I also didn't feel like rewriting the query into DQL, so I ultimately hacked in my own support by duplicating the LEFT JOIN functionality. I figured I'd share my patch in case it helps others facing a similar issue.