Ejemplo n.º 1
0
 /**
  * @param KalturaPropertyInfo $property
  */
 public function validateHtmlTags($className, $property)
 {
     if ($property->getType() != 'string') {
         return;
     }
     $propName = $property->getName();
     $value = $this->{$propName};
     return kHtmlPurifier::purify($className, $propName, $value);
 }
Ejemplo n.º 2
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);
         }
     }
 }