Script protection

This commit is contained in:
bergware
2021-08-12 10:56:29 +02:00
parent d266020764
commit 3fec3fe37c
@@ -19,6 +19,9 @@ require_once "$docroot/webGui/include/Translations.php";
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
function unscript($text) {
return preg_replace('#<script(.*?)>(.+?)</script>#','',html_entity_decode($text));
}
function safe($text) {
return preg_replace('/[!@#$%^&\*\(\)\[\]{}"\|\?<>\/;]+/','',unscript(html_entity_decode($text)));
}