Skip to content

Chmod 640 for uploaded file after SUPEE 7405 patch

After installing the SUPEE 7405 patch, we noticed a problem uploading images from the admin. All file permissions are being set to CHMOD 640 which makes them inaccessible to all users. Is there a solution that does not involve rewriting the /lib/Varien/File/Uploader.php file? Answer A new version of SUPEE-740…

How can I easily switch between PHP versions on Mac OSX?

I would like to test my application on PHP 5.3 up to PHP 7.0. Where and how can I install the versions and how can I switch them by running a small script? Answer If you have both versions of PHP installed, you can switch between versions using the link and unlink brew commands. For example, to switch between…

View pdf file in browser instead of downloading

header(“Content-Length: ” . filesize (‘theme/assets/pdf/ci.pdf’ ) ); header(“Content-type: application/pdf”); header(“Content-disposition: attachment; filename=”.basename(‘theme/assets/pdf/ci….

How to use a Function of Switch/Case, if at all?

I have various products inside a database, each has its own price, the pattern to output a product price is: $product[i][“price”] I also have various “product types”, which are manually defined in my code, each with index number that will relate to each product accordingly: I want to e…