From dc2f37255122b98d100a35e83d6fc71c83d2d073 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 2 Oct 2015 20:06:25 -0700 Subject: [PATCH] Add missing encode_entities() to export_factoids() --- PBot/Factoids.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index 8a9e5473..13dea82e 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -177,7 +177,7 @@ sub export_factoids { print FILE "\n"; } - print FILE "" . $self->{factoids}->hash->{$channel}->{$trigger}->{owner} . "\n"; + print FILE "" . encode_entities($self->{factoids}->hash->{$channel}->{$trigger}->{owner}) . "\n"; print FILE "" . encode_entities(strftime "%Y/%m/%d %H:%M:%S", localtime $self->{factoids}->hash->{$channel}->{$trigger}->{created_on}) . "\n"; print FILE "" . $self->{factoids}->hash->{$channel}->{$trigger}->{ref_count} . "\n"; @@ -190,9 +190,9 @@ sub export_factoids { my $with_args = $self->{factoids}->hash->{$channel}->{$trigger}->{action_with_args}; $with_args =~ s/(.*?)http(s?:\/\/[^ ]+)/encode_entities($1) . "http" . encode_entities($2) . "<\/a>"/ge; $with_args =~ s/(.*)<\/a>(.*$)/"$1<\/a>" . encode_entities($2)/e; - print FILE "$trigger is $action

with_args: $with_args\n"; + print FILE "" . encode_entities($trigger) . " is " . encode_entities($action) . "

with_args: " . encode_entities($with_args) . "\n"; } else { - print FILE "$trigger is $action\n"; + print FILE "" . encode_entities($trigger) . " is " . encode_entities($action) . "\n"; } if(exists $self->{factoids}->hash->{$channel}->{$trigger}->{edited_by}) { @@ -203,7 +203,7 @@ sub export_factoids { print FILE "\n"; } - print FILE "" . $self->{factoids}->hash->{$channel}->{$trigger}->{ref_user} . "\n"; + print FILE "" . encode_entities($self->{factoids}->hash->{$channel}->{$trigger}->{ref_user}) . "\n"; if(exists $self->{factoids}->hash->{$channel}->{$trigger}->{last_referenced_on}) { print FILE "" . encode_entities(strftime "%Y/%m/%d %H:%M:%S", localtime $self->{factoids}->hash->{$channel}->{$trigger}->{last_referenced_on}) . "\n";