htmlpurifier mit borderRadius

Wie erlaube ich borderRadius mit htmlpurifier?

Ich habe das gefunden, aber es scheint nicht mit der aktuellen Version von htmlpurifier zu funktionieren. Vielleicht haben sie die Art und Weise geändert, wie Sie Ihre eigene CSS hinzufügen?

http://htmlpurifier.org/phorum/read.php?2,6154,6154

  $config = HTMLPurifier_Config::createDefault();

  // add some custom CSS3 properties                                                                                                                                              
  $css_definition = $config->getDefinition('CSS');

  $border_radius =
    $info['border-top-left-radius'] =
    $info['border-top-right-radius'] =
    $info['border-bottom-left-radius'] =
    $info['border-bottom-right-radius'] =
    new HTMLPurifier_AttrDef_CSS_Composite(array(
                                             new HTMLPurifier_AttrDef_CSS_Length('0'),
                                             new HTMLPurifier_AttrDef_CSS_Percentage(true)
                                             ));

  $info['border-radius'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_radius);

  // wrap all new attr-defs with decorator that handles !important                                                                                                                
  $allow_important = $config->get('CSS.AllowImportant');
  foreach ($info as $k => $v) {
    $css_definition->info[$k] = new HTMLPurifier_AttrDef_CSS_ImportantDecorator($v, $allow_important);
  }

  $html_purifier = new HTMLPurifier($config);

Antworten auf die Frage(1)

Ihre Antwort auf die Frage