public function cleanUpUTF8()
{
$data = & $this->getData();
- array_walk_recursive($data, array('UtfNormal', 'cleanUp'));
+ array_walk_recursive($data, array('ApiResult', 'cleanUp_helper'));
+ }
+
+ private static function cleanUp_helper($s)
+ {
+ if(!is_string($s))
+ return $s;
+ return UtfNormal::cleanUp($s);
}
public function execute() {
* @return string a clean, shiny, normalized UTF-8 string
*/
static function cleanUp( $string ) {
- if( !is_string( $string ) ) {
- return $string;
- }
if( NORMALIZE_ICU ) {
# We exclude a few chars that ICU would not.
$string = preg_replace(