private function filterValue($id, $value) { if (in_array($id, sgConfiguration::get('settings.FlatCMSEditorPlugin.textarea_fields'))) { return FlatCMSEditorPluginConfiguration::getPurifier()->purify($value); } return filter_var($value, FILTER_SANITIZE_STRING); }
public static function getPurifier() { if (self::$purifier instanceof HTMLPurifier) { return self::$purifier; } require_once dirname(__FILE__) . '/../lib/vendor/htmlpurifier/library/HTMLPurifier.auto.php'; $config = HTMLPurifier_Config::createDefault(); $config->set('Cache.SerializerPath', sgConfiguration::get('settings.cache_dir')); self::$purifier = new HTMLPurifier($config); return self::$purifier; }