aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php47
1 files changed, 46 insertions, 1 deletions
diff --git a/boot.php b/boot.php
index 9f825ddfd..fab44a7a4 100644
--- a/boot.php
+++ b/boot.php
@@ -311,4 +311,49 @@ function notice($s) {
$_SESSION['sysmsg'] .= $s;
-}} \ No newline at end of file
+}}
+
+
+if(! function_exists('xmlify')) {
+function xmlify($str) {
+ $buffer = '';
+
+ for($x = 0; $x < strlen($str); $x ++) {
+ $char = $str[$x];
+
+ switch( $char ) {
+
+ case "\r" :
+ break;
+ case "&" :
+ $buffer .= '&amp;';
+ break;
+ case "'" :
+ $buffer .= '&apos;';
+ break;
+
+ case "\"" :
+ $buffer .= '&quot;';
+ break;
+ case '<' :
+ $buffer .= '&lt;';
+ break;
+ case '>' :
+ $buffer .= '&gt;';
+ break;
+ case "\n" :
+ $buffer .= ' ';
+ break;
+ default :
+ $buffer .= $char;
+ break;
+ }
+ }
+ $buffer = trim($buffer);
+ return($buffer);
+}}
+
+
+function hex2bin($s) {
+ return(pack("H*",$s));
+} \ No newline at end of file