2011-10-20 Sergio Martin <sergio.martin@artica.es>

* lib/PandoraFMS/Tools.pm: Fixed safe_input and output to
	convert manually several more extended ascii characters. 
	Revert the last fix in safe_input because Junichi warn us the
	danger of broke multibyte chars. Thanks Junichi.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5069 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2011-10-20 07:56:53 +00:00
parent 7253a6aa86
commit b0a5b41ff7
2 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2011-10-20 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/Tools.pm: Fixed safe_input and output to
convert manually several more extended ascii characters.
Revert the last fix in safe_input because Junichi warn us the
danger of broke multibyte chars. Thanks Junichi.
2011-10-19 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/Tools.pm: Fixed safe_input function to encode

View File

@ -112,6 +112,12 @@ sub safe_input($) {
my $hex = ascii_to_html($i);
$value =~ s/$pattern/$hex/gi;
}
for (my $i=128;$i<191;$i++) {
my $pattern = chr($i);
my $hex = ascii_to_html($i);
$value =~ s/$pattern/$hex/gi;
}
#//Replace characteres for tildes and others
my $trans = get_html_entities();
@ -131,7 +137,7 @@ sub safe_input($) {
sub safe_output($) {
my $value = shift;
$value = decode_entities ($value);
$value = decode_entities ($value, "'<>&");
#//Replace the character '\' for the equivalent html entitie
$value =~ s/&#92;/\\/gi;
@ -153,6 +159,12 @@ sub safe_output($) {
my $hex = ascii_to_html($i);
$value =~ s/$hex/$pattern/gi;
}
for (my $i=128;$i<191;$i++) {
my $pattern = chr($i);
my $hex = ascii_to_html($i);
$value =~ s/$hex/$pattern/gi;
}
#//Replace characteres for tildes and others
my $trans = get_html_entities();