|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mrwrighty Smarty n00b
Joined: 12 Jun 2015 Posts: 2
|
Posted: Fri Jun 12, 2015 3:07 pm Post subject: SuiteCRM cannot fix error in Smarty_Compliler.class.php |
|
|
Hi I'm using SuiteCRM and getting the following error on a server running PHP5.5:-
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/adgcrm/public_html/include/Smarty/Smarty_Compiler.class.php on line 268
I have edited the script according to suggestions on this site to this:-
$source_content = preg_replace_callback($search, create_function ('$matches', "return '"
. $this->_quote_replace($this->left_delimiter) . 'php'
. "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'"
. $this->_quote_replace($this->right_delimiter)
. "';")
, $source_content);
But I am still getting the same error. Any thoughts please. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Jun 13, 2015 6:01 pm Post subject: |
|
|
You must have edited not the Smarty_Compiler.class.php called by your application. |
|
Back to top |
|
mrwrighty Smarty n00b
Joined: 12 Jun 2015 Posts: 2
|
Posted: Mon Jun 15, 2015 10:40 am Post subject: |
|
|
Yes I have, the file is shown in the path in the error in my original post.
/public_html/include/Smarty/Smarty_Compiler.class.php
Here is the surrounding code from the file
/* fetch all special blocks */
$search = "~{$ldq}\*(.*?)\*{$rdq}|{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}|{$ldq}\s*php\s*{$rdq}(.*?){$ldq}\s*/php\s*{$rdq}~s";
preg_match_all($search, $source_content, $match, PREG_SET_ORDER);
$this->_folded_blocks = $match;
reset($this->_folded_blocks);
/* replace special blocks by "{php}" */
$source_content = preg_replace_callback($search, create_function ('$matches', "return '"
. $this->_quote_replace($this->left_delimiter) . 'php'
. "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'"
. $this->_quote_replace($this->right_delimiter)
. "';")
, $source_content);
/* Gather all template tags. */
preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match);
$template_tags = $_match[1];
/* Split content by template tags to obtain non-template content. */
$text_blocks = preg_split("~{$ldq}.*?{$rdq}~s", $source_content);
/* loop through text blocks */ |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Jun 15, 2015 9:47 pm Post subject: |
|
|
If you have caching enabled it's possible that the output of the error message is in your cache file. Empty the cache folder and try again. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|