26 public static function clean($html)
29 'html' => array(
'xmlns'),
32 'meta' => array(
'content',
'name',
'http-equiv'),
35 'link' => array(
'type',
'rel',
'href'),
39 foreach ($tags as $tagName => $attributes)
41 $tags[$tagName] = array_merge($attributes, $commonAttributes);
44 $sanitizer = new \CBXSanitizer();
45 $sanitizer->setLevel(\CBXSanitizer::SECURE_LEVEL_LOW);
46 $sanitizer->addTags($tags);
47 $sanitizer->allowAttributes([
53 'content' =>
function ()
59 $sanitizer->applyDoubleEncode(
false);
61 $storedMap = self::replacePhpToTags($html);
62 $html = $sanitizer->sanitizeHtml($html);
63 self::replaceTagsToPhp($html, $storedMap);
133 if(!preg_match_all(
'/(<\?[\W\w\n]*?\?>)/i', $html, $matches, PREG_SET_ORDER))