I have this code:
$str = '(Test)';
$final = preg_replace('/\[translate=([a-z]{2})(.*)\]'.preg_quote($matches[3][$i]).'\[\/translate(.*)\]/',$str,$final,-1,$ct);
It handles a situation like this okay:
test0[translate=en]Hello![/translate]test1
Which comes out as:
test0(Test)test1
But in this situation:
[quote:3ggw49so][translate=en]Hello![/translate][/quote:3ggw49so]
It comes out as:
[quote:3ggw49so](Test)
$matches[3][$i] is "Hello!" in this case and $str is "(Test)", and final is the full string that gets overwritten. So it's removing the [/quote:3ggw49so] part, why is that?