Remove reduntant regex from calls to StringUtils::isUtf8()
authorlwelling <lwelling@wikimedia.org>
Fri, 3 May 2013 20:29:03 +0000 (16:29 -0400)
committerReedy <reedy@wikimedia.org>
Sat, 21 Sep 2013 01:59:49 +0000 (02:59 +0100)
commit7a344588d36cf825a98dcb6a72779e711a803dfa
tree7de0dccc9b23553e67797c1132a71b1c5e6efe60
parent577229658c5a0ed104e4caede2234dd3a8bbe8d4
Remove reduntant regex from calls to StringUtils::isUtf8()

I've cautiously moved the regex out of the most used code path.
There is no string that will match that regex check that will not also be
passed by mb_check_encoding.  I think the regex was intended as a shortcut
evaluation, but it is no faster than mb_check_encoding which will often
need to be run anyway.

I think it could just be deleted, but I have limited motivation to
risk introducing a bug to improve performance on old PHP vesions and
unusual configurations, so I've moved it to the fallback code path.

Change-Id: Ie9425cc23ba032e5aff42beeb44cbb1146050452
includes/StringUtils.php