added normalizeUnicode() method to OC_Util
This commit is contained in:
parent
d4b700ef4e
commit
661b5501b0
14
lib/util.php
14
lib/util.php
|
@ -1,4 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once 'Patchwork/PHP/Shim/Normalizer.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for utility functions
|
* Class for utility functions
|
||||||
*
|
*
|
||||||
|
@ -823,5 +826,16 @@ class OC_Util {
|
||||||
return $theme;
|
return $theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Normalize a unicode string
|
||||||
|
* @param string $value a not normalized string
|
||||||
|
* @return bool|string
|
||||||
|
*/
|
||||||
|
public static function normalizeUnicode($value) {
|
||||||
|
if(class_exists('Patchwork\PHP\Shim\Normalizer')) {
|
||||||
|
$value = \Patchwork\PHP\Shim\Normalizer::normalize($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue