|
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 |
yaseek Smarty n00b
Joined: 28 May 2007 Posts: 4
|
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Jul 09, 2007 10:35 am Post subject: |
|
|
Hi.
I'm not sure I understand precisely but the trimwhitespace filter mangles <script> blocks via a PHP preg_replace() call. Is that case covered by your mb_ changes that you mentioned? |
|
Back to top |
|
yaseek Smarty n00b
Joined: 28 May 2007 Posts: 4
|
Posted: Mon Jul 09, 2007 1:41 pm Post subject: |
|
|
boots wrote: | Hi.
I'm not sure I understand precisely but the [url=http://cvs.php.net/viewvc.cgi/smarty/libs/plugins/outputfilter.trimwhitespace.php?view=markup]trimwhitespace filter mangles <script> blocks via a PHP preg_replace() call. Is that case covered by your mb_ changes that you mentioned? |
hmm, may be error in mb_preg_replace()?
...i'll test it tomorrow[/url]
Last edited by yaseek on Wed May 05, 2010 10:51 pm; edited 1 time in total |
|
Back to top |
|
yaseek Smarty n00b
Joined: 28 May 2007 Posts: 4
|
Posted: Fri Aug 31, 2007 11:00 am Post subject: |
|
|
boots wrote: | Hi.
I'm not sure I understand precisely but the [url=http://cvs.php.net/viewvc.cgi/smarty/libs/plugins/outputfilter.trimwhitespace.php?view=markup]trimwhitespace filter mangles <script> blocks via a PHP preg_replace() call. Is that case covered by your mb_ changes that you mentioned? |
Function substr_replace() in smarty_outputfilter_trimwhitespace_replace() dosn't have an mb_ reflection If page contains an utf8-symbols your filter dosn't work.
Solution:
change $subject = substr_replace($subject, $replace[$_i], $_pos, $_len);
with $subject = preg_replace('/'.$search_str.'/', $replace[$_i], $subject, 1);
...and this will work ok in all cases (ascii/utf8)[/url] |
|
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
|