Exemplo n.º 1
0
 public static function initAllowedTokenPatterns()
 {
     $cacheKey = null;
     if (function_exists('apc_fetch') && function_exists('apc_store')) {
         $cacheKey = 'kHtmlPurifierAllowedTokenPatterns-' . kConf::getCachedVersionId();
         self::$allowedTokenPatterns = apc_fetch($cacheKey);
     }
     if (!self::$allowedTokenPatterns) {
         self::$allowedTokenPatterns = kConf::get("xss_allowed_token_patterns");
         self::$allowedTokenPatterns = preg_replace("/\\\\/", "\\", self::$allowedTokenPatterns);
         if ($cacheKey) {
             apc_store($cacheKey, self::$allowedTokenPatterns);
         }
     }
 }