Add lib/utils.php file

Added simple shell/utf/html escape checking
Added a collection of test cases (we need some more escape checking ones)

Signed-off-by: Diederik de Groot <ddegroot@talon.nl>
This commit is contained in:
Diederik de Groot
2020-02-16 08:57:02 +01:00
parent 00b1241dfc
commit d039261022
2 changed files with 60 additions and 26 deletions

10
lib/utils.php Normal file
View File

@@ -0,0 +1,10 @@
<?php
//
// Helper functions
//
function utf8_urldecode($str) {
$str = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($str));
return html_entity_decode($str,null,'UTF-8');;
}
?>