From 9a6a60a9c1c7f781790849173e309ac0664d7b35 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Thu, 8 Jul 2010 07:03:25 -0700 Subject: mucho progress on notifier, email style dfrn url's --- boot.php | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'boot.php') 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 .= '&'; + break; + case "'" : + $buffer .= '''; + break; + + case "\"" : + $buffer .= '"'; + break; + case '<' : + $buffer .= '<'; + break; + case '>' : + $buffer .= '>'; + 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 -- cgit v1.2.3