Skip to content

Instantly share code, notes, and snippets.

Avatar

Digital Pianism digitalpianism

View GitHub Profile
@digitalpianism
digitalpianism / emailTemplatesGenerator.php
Last active May 25, 2018
Dirty Magento Shell script to send all transactional emails
View emailTemplatesGenerator.php
<?php
/**
To run and send all emails:
php -f emailTemplateGenerator.php -- -email raphael@me.com
Tun run and send one email:
php -f emailTemplateGenerator.php -- -email raphael@me.com -template 46
*/
require_once 'abstract.php';
@digitalpianism
digitalpianism / diff
Created Nov 15, 2016
Security fix in 1.9.3.1
View diff
diff --git a/app/code/core/Mage/Customer/Model/Session.php b/app/code/core/Mage/Customer/Model/Session.php
index 623fa39..b5e5eda 100644
--- a/app/code/core/Mage/Customer/Model/Session.php
+++ b/app/code/core/Mage/Customer/Model/Session.php
@@ -222,6 +222,7 @@ class Mage_Customer_Model_Session extends Mage_Core_Model_Session_Abstract
{
$this->setCustomer($customer);
$this->renewSession();
+ Mage::getSingleton('core/session')->renewFormKey();
Mage::dispatchEvent('customer_login', array('customer'=>$customer));
@digitalpianism
digitalpianism / Dynamic events
Last active Apr 14, 2017
Magento 1.9.3.2: list of dispatched events
View Dynamic events
$this->_eventPrefix.'_clear' // Mage_Core_Model_Abstract
$this->_eventPrefix.'_delete_after' // Mage_Core_Model_Abstract
$this->_eventPrefix.'_delete_before' // Mage_Core_Model_Abstract
$this->_eventPrefix.'_delete_commit_after' // Mage_Core_Model_Abstract
$this->_eventPrefix.'_load_after' // Mage_Core_Model_Abstract
$this->_eventPrefix.'_load_before' // Mage_Core_Model_Abstract
$this->_eventPrefix.'_save_after' // Mage_Core_Model_Abstract
$this->_eventPrefix.'_save_before' // Mage_Core_Model_Abstract
$this->_eventPrefix.'_save_commit_after' // Mage_Core_Model_Abstract
$this->_eventPrefix.'_load_after' // Mage_Core_Model_Resource_Db_Collection_Abstract
@digitalpianism
digitalpianism / gist:14a15cd52baede0e5d600e8c653f33e9
Last active Mar 21, 2017
Diff between 1.9.3 and 1.9.2.4 + SUPEE-8788 / Don't mind the app/Mage.php autoloader patch ;)
View gist:14a15cd52baede0e5d600e8c653f33e9
diff --git a/.htaccess b/.htaccess
index aca7f55..63e1729 100644
--- a/.htaccess
+++ b/.htaccess
@@ -144,6 +144,21 @@
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]
+<IfModule mod_setenvif.c>
+ <IfModule mod_headers.c>