set('HTML.Allowed', 'p,br,strong,em,u,h1,h2,h3,h4,h5,h6,ul,ol,li,blockquote,a[href],img[src|alt|width|height]'); // Attributs autorisés $config->set('HTML.AllowedAttributes', 'href,src,alt,width,height,title'); // Configuration du cache $config->set('Cache.DefinitionImpl', 'Serializer'); $config->set('Cache.SerializerPath', $cacheDir); return new HTMLPurifier($config); } }