/** * @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); }
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); } } }