diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 19f4dbaee2..0bc4c4ed17 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,10 @@ +2011-10-20 Sergio Martin + + * 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 * lib/PandoraFMS/Tools.pm: Fixed safe_input function to encode diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index c14ac69465..285b39bf2c 100644 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -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/\/\\/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();