Change substr_replace usage in previous fix.