Yes that is correct...I'm only checking for the presence for at least one backslash character (which would show up in all 3 of the cases being checked against for the str_replace call).
If there is at least one backslash then we need to process the str_replace call because there's a strong chance it'll be needed.
If there isn't at least one backslash then we don't need to process the str_replace call.
I believe that covers things correctly.
Mainly what I observed was that the vast majority of our language strings do not contain any of those 3 characters so running the str_replace call all of the time on every since language string was unnecessary (and there are lots of these calls). The extra if statement helps to avoid them with the faster strpos check.
Hi Andre,
Yes that is correct...I'm only checking for the presence for at least one backslash character (which would show up in all 3 of the cases being checked against for the str_replace call).
If there is at least one backslash then we need to process the str_replace call because there's a strong chance it'll be needed.
If there isn't at least one backslash then we don't need to process the str_replace call.
I believe that covers things correctly.
Mainly what I observed was that the vast majority of our language strings do not contain any of those 3 characters so running the str_replace call all of the time on every since language string was unnecessary (and there are lots of these calls). The extra if statement helps to avoid them with the faster strpos check.