mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
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:
parent
7253a6aa86
commit
b0a5b41ff7
@ -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>
|
2011-10-19 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/Tools.pm: Fixed safe_input function to encode
|
* lib/PandoraFMS/Tools.pm: Fixed safe_input function to encode
|
||||||
|
@ -112,6 +112,12 @@ sub safe_input($) {
|
|||||||
my $hex = ascii_to_html($i);
|
my $hex = ascii_to_html($i);
|
||||||
$value =~ s/$pattern/$hex/gi;
|
$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
|
#//Replace characteres for tildes and others
|
||||||
my $trans = get_html_entities();
|
my $trans = get_html_entities();
|
||||||
@ -131,7 +137,7 @@ sub safe_input($) {
|
|||||||
sub safe_output($) {
|
sub safe_output($) {
|
||||||
my $value = shift;
|
my $value = shift;
|
||||||
|
|
||||||
$value = decode_entities ($value);
|
$value = decode_entities ($value, "'<>&");
|
||||||
|
|
||||||
#//Replace the character '\' for the equivalent html entitie
|
#//Replace the character '\' for the equivalent html entitie
|
||||||
$value =~ s/\/\\/gi;
|
$value =~ s/\/\\/gi;
|
||||||
@ -153,6 +159,12 @@ sub safe_output($) {
|
|||||||
my $hex = ascii_to_html($i);
|
my $hex = ascii_to_html($i);
|
||||||
$value =~ s/$hex/$pattern/gi;
|
$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
|
#//Replace characteres for tildes and others
|
||||||
my $trans = get_html_entities();
|
my $trans = get_html_entities();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user