purifier 1차 적용

This commit is contained in:
Hide_D committed 2018-06-24 03:47:44 +09:00
1 parent 5c82edc4be
commit 5ca8a6ecfa
7 files changed
+35 -30

No files matched your search

+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);
}
}