purifier 1차 적용

This commit is contained in:
2018-06-24 03:47:44 +09:00
parent 5c82edc4be
commit 5ca8a6ecfa
7 changed files with 35 additions and 30 deletions
+10
View File
@@ -125,4 +125,14 @@ class WebUtil
}
return "<link rel='stylesheet' type='text/css' href='{$path}{$tail}' />\n";
}
public static function htmlPurify(?string $text): string{
if(!$text){
return '';
}
$config = \HTMLPurifier_HTML5Config::createDefault();
$purifier = new \HTMLPurifier($config);
return $purifier->purify($text);
}
}