diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index 13dea82e..0ba1fbbb 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -183,16 +183,21 @@ sub export_factoids { print FILE "" . $self->{factoids}->hash->{$channel}->{$trigger}->{ref_count} . "\n"; my $action = $self->{factoids}->hash->{$channel}->{$trigger}->{action}; - $action =~ s/(.*?)http(s?:\/\/[^ ]+)/encode_entities($1) . "http" . encode_entities($2) . "<\/a>"/ge; - $action =~ s/(.*)<\/a>(.*$)/"$1<\/a>" . encode_entities($2)/e; + + if ($action =~ m/https?:\/\/[^ ]+/) { + $action =~ s/(.*?)http(s?:\/\/[^ ]+)/encode_entities($1) . "http" . encode_entities($2) . "<\/a>"/ge; + $action =~ s/(.*)<\/a>(.*$)/"$1<\/a>" . encode_entities($2)/e; + } else { + $action = encode_entities($action); + } if(exists $self->{factoids}->hash->{$channel}->{$trigger}->{action_with_args}) { 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 "" . encode_entities($trigger) . " is " . encode_entities($action) . "

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

with_args: " . encode_entities($with_args) . "\n"; } else { - print FILE "" . encode_entities($trigger) . " is " . encode_entities($action) . "\n"; + print FILE "" . encode_entities($trigger) . " is $action\n"; } if(exists $self->{factoids}->hash->{$channel}->{$trigger}->{edited_by}) {