Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-05-24 22:35:01 +0400
committerFlorin Peter <github@florin-peter.de>2013-05-24 22:35:01 +0400
commit661b5501b0e3f456d3a56d72e342074062ded0e8 (patch)
tree9997388d69d04a18f623589d692683b6c4d75b1f /lib/util.php
parentd4b700ef4ebfa9aba9bcadda864ed5a2a92174ed (diff)
added normalizeUnicode() method to OC_Util
Diffstat (limited to 'lib/util.php')
-rwxr-xr-xlib/util.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php
index 01e2df7bfc4..224ed32061c 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -1,4 +1,7 @@
<?php
+
+require_once 'Patchwork/PHP/Shim/Normalizer.php';
+
/**
* Class for utility functions
*
@@ -823,5 +826,16 @@ class OC_Util {
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;
+ }
}