Quote:
Originally Posted by kh99
Strange. The above works for me, so I'm not sure what to try.
|
Yes, it is very strange.
I deleted the plugin, created another one, copied the same code above, and tested. Doesn't work at all.
EDIT: Changed the preg_replace to str_replace, and it worked (however, without the boundaries). preg_replace is indeed returning null here, and I can't understand why.
--------------- Added [DATE]1328410811[/DATE] at [TIME]1328410811[/TIME] ---------------
Ok, here we have some news:
I was wondering why preg_replace remains returning NULL, even with silly/obvious examples. I changed it to str_replace and it worked. However, I need to manipulate strings in such a way that str_replace can't.
I've searched for the preg_replace returning NULL issue, and found this link:
http://www.pelagodesign.com/blog/200...-returns-null/
Quote:
In PHP 5.2, Perl Compatible Regular Expressions (PCRE) introduced with little fanfare a PHP setting called backtrack_limit, which, for the first time, set a limit on the number of backtracks a regular expression could perform before it stops operating and reports an error. Unfortunately, when PCRE encounters an error of this type, it doesn?t report a notice or warning or error. All it does is return NULL (...)
|
Then I went to my php.init file, to set a higher backtrack_limit.
After that, in the admincp->maintenance-> PHP Info, I've found this:
Directive Local Value Master Value
pcre.backtrack_limit -1 20000000
pcre.recursion_limit 20000000 20000000
So, what I need now is to change the local value to the master value, which I don't know how to :S
Any ideas?
Thanks in advance!