Skip to content

Instantly share code, notes, and snippets.

@toluolubajo
Created May 27, 2014 09:54
Show Gist options
  • Select an option

  • Save toluolubajo/5e5b07e271f9f3cc6b9f to your computer and use it in GitHub Desktop.

Select an option

Save toluolubajo/5e5b07e271f9f3cc6b9f to your computer and use it in GitHub Desktop.
Fix for Deprecated functionality: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in lib/Varien/Filter/Template/Simple.php on line 42
class Varien_Filter_Template_Simple extends Varien_Object implements Zend_Filter_Interface
{
protected $_startTag = '{{';
protected $_endTag = '}}';
public function setTags($start, $end)
{
$this->_startTag = $start;
$this->_endTag = $end;
return $this;
}
public function filter($value)
{
return preg_replace_callback('#'.$this->_startTag.'(.*?)'.$this->_endTag.'#', array($this, '__getData'), $value);
}
public function __getData($matches)
{
return $this->getData($matches[1]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment