]> source.dussan.org Git - nextcloud-server.git/commitdiff
Merge branch 'master' into move-maint-start
authorThomas Mueller <thomas.mueller@tmit.eu>
Fri, 14 Jun 2013 08:06:13 +0000 (10:06 +0200)
committerThomas Mueller <thomas.mueller@tmit.eu>
Fri, 14 Jun 2013 08:06:13 +0000 (10:06 +0200)
Conflicts:
lib/util.php

1  2 
lib/base.php
lib/util.php

diff --cc lib/base.php
Simple merge
diff --cc lib/util.php
index a7ed03792949ccaddcab759dcfe130579bd0892b,95af22ed0eedfa9481ae2f63b7caa997ba32a307..ddef0c63c55da806099ff4912f940614aa52263a
@@@ -822,24 -832,21 +832,41 @@@ class OC_Util 
                return $theme;
        }
  
 +      /**
 +       * Clear the opcode cache if one exists
 +       * This is necessary for writing to the config file
 +       * in case the opcode cache doesn't revalidate files
 +       */
 +      public static function clearOpcodeCache() {
 +              // APC
 +              if (function_exists('apc_clear_cache')) {
 +                      apc_clear_cache();
 +              }
 +              // Zend Opcache
 +              if (function_exists('accelerator_reset')) {
 +                      accelerator_reset();
 +              }
 +              // XCache
 +              if (function_exists('xcache_clear_cache')) {
 +                      xcache_clear_cache(XC_TYPE_VAR, 0);
 +              }
 +      }
 +
+       /**
+        * 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')) {
+                       $normalizedValue = \Patchwork\PHP\Shim\Normalizer::normalize($value);
+                       if($normalizedValue === false) {
+                               \OC_Log::write( 'core', 'normalizing failed for "' . $value . '"', \OC_Log::WARN);
+                       } else {
+                               $value = $normalizedValue;
+                       }
+               }
+               return $value;
+       }
  }