Created new general purpose Secure.php module

This commit is contained in:
bergware
2021-08-13 12:00:38 +02:00
parent b100e37528
commit 24a4a84e9d
3 changed files with 22 additions and 14 deletions
+1 -6
View File
@@ -13,6 +13,7 @@
<?
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Wrappers.php";
require_once "$docroot/webGui/include/Secure.php";
// Helper functions
function my_scale($value, &$unit, $decimals=NULL, $scale=NULL, $kilo=1000) {
@@ -263,10 +264,4 @@ function my_explode($split,$text,$count=2) {
function my_preg_split($split,$text,$count=2) {
return array_pad(preg_split($split,$text,$count),$count,'');
}
function unscript($text) {
return preg_replace('#<script(.*?)>(.+?)</script>#','',html_entity_decode($text));
}
function unhook($text) {
return preg_replace("/['\"](.*)?['\"];?.+$/",'',unscript($text));
}
?>