Skip to content

Instantly share code, notes, and snippets.

View digitalpianism's full-sized avatar

Raph Petrini digitalpianism

  • France
  • 10:46 (UTC +01:00)
View GitHub Profile
@digitalpianism
digitalpianism / emailTemplatesGenerator.php
Last active May 25, 2018 10:55
Dirty Magento Shell script to send all transactional emails
<?php
/**
To run and send all emails:
php -f emailTemplateGenerator.php -- -email [email protected]
Tun run and send one email:
php -f emailTemplateGenerator.php -- -email [email protected] -template 46
*/
require_once 'abstract.php';
@digitalpianism
digitalpianism / diff
Created November 15, 2016 10:53
Security fix in 1.9.3.1
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 April 14, 2017 07:24
Magento 1.9.3.2: list of dispatched 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 March 21, 2017 09:32
Diff between 1.9.3 and 1.9.2.4 + SUPEE-8788 / Don't mind the app/Mage.php autoloader patch ;)
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>