Created
May 26, 2014 23:53
-
-
Save herveguetin/93f726bde76f44188673 to your computer and use it in GitHub Desktop.
Bugfix in Mage_Core_Model_Email_Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<php | |
/** | |
* Parse variables string into array of variables | |
* | |
* @param string $variablesString | |
* @return array | |
*/ | |
protected function _parseVariablesString($variablesString) | |
{ | |
$variables = array(); | |
if ($variablesString && is_string($variablesString)) { | |
$variablesString = str_replace("\n", '', $variablesString); | |
// Bugfixes - need to replace line break by nothing + need to remove leading comma for proper JSON decoding | |
$variablesString = str_replace("\r", '', $variablesString); | |
$variablesString = str_replace(",}", '}', $variablesString); | |
$variables = Zend_Json::decode($variablesString); | |
} | |
return $variables; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment