2009-03-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* 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
This commit is contained in:
parent
0af6741e74
commit
7509de6082
pandora_console/include
|
@ -58,12 +58,12 @@ function safe_input ($value) {
|
||||||
* @return mixed The cleaned string or array.
|
* @return mixed The cleaned string or array.
|
||||||
*/
|
*/
|
||||||
function safe_output_xml ($string) {
|
function safe_output_xml ($string) {
|
||||||
if (is_numeric ($value))
|
if (is_numeric ($string))
|
||||||
return $value;
|
return $string;
|
||||||
|
|
||||||
if (is_array ($value)) {
|
if (is_array ($string)) {
|
||||||
array_walk ($value, 'safe_output_xml');
|
array_walk ($string, 'safe_output_xml');
|
||||||
return $value;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
static $table;
|
static $table;
|
||||||
|
@ -82,7 +82,7 @@ function safe_output_xml ($string) {
|
||||||
|
|
||||||
//now perform a replacement using preg_replace
|
//now perform a replacement using preg_replace
|
||||||
//each matched value in $table will be replaced with the corresponding value in $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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue