From 7509de6082bce225ba5b8bc9528f87121c9b322c Mon Sep 17 00:00:00 2001 From: guruevi Date: Thu, 12 Mar 2009 20:17:56 +0000 Subject: [PATCH] 2009-03-12 Evi Vanoost * include/functions.php: Added safe_output_xml which makes variables clean for output converting html entities into numeric entities understood by all XML validators - fixed small mistake * operation/events/events_rss.php: Used safe_output_xml where needed. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1532 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/include/functions.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 310ca76761..7a3c9c1a79 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -58,12 +58,12 @@ function safe_input ($value) { * @return mixed The cleaned string or array. */ function safe_output_xml ($string) { - if (is_numeric ($value)) - return $value; + if (is_numeric ($string)) + return $string; - if (is_array ($value)) { - array_walk ($value, 'safe_output_xml'); - return $value; + if (is_array ($string)) { + array_walk ($string, 'safe_output_xml'); + return $string; } static $table; @@ -82,7 +82,7 @@ function safe_output_xml ($string) { //now perform a replacement using preg_replace //each matched value in $table will be replaced with the corresponding value in $replace - return preg_replace ($table, $replace, $value); + return preg_replace ($table, $replace, $string); } /**