Skip to content

Commit

Permalink
striped too much from urls.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulej72 committed Jun 26, 2015
1 parent 895e91b commit 4295440
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Slash/Constants/Constants.pm
Expand Up @@ -161,6 +161,7 @@ user-definable constants (for journals, comments) should be E<gt>= 1. All
else should be E<lt> 1. If adding new user-definable modes, make sure to
change Slash::Data::strip_mode() to allow the new value.
NOHTMLURL
ANCHOR
NOTAGS
ATTRIBUTE
Expand All @@ -178,7 +179,7 @@ change Slash::Data::strip_mode() to allow the new value.
=cut
# -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 77
# -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 77
=head2 people
Expand Down
1 change: 1 addition & 0 deletions Slash/Display/Display.pm
Expand Up @@ -361,6 +361,7 @@ my $strip_mode = sub {
strip_html => \&strip_html,
strip_literal => \&strip_literal,
strip_nohtml => \&strip_nohtml,
strip_nohtmlurl => \&strip_nohtmlurl,
strip_notags => \&strip_notags,
strip_plaintext => \&strip_plaintext,
strip_subject => \&strip_subject,
Expand Down
7 changes: 5 additions & 2 deletions Slash/Utility/Data/Data.pm
Expand Up @@ -1347,7 +1347,7 @@ sub _remove_tags {
$url = $encoder->decode($url);
$i++;
}
$url = strip_nohtml($url);
$url = strip_nohtmlurl($url);
$url = $encoder->encode($url);
return 'href="'.$url.'"';

Expand Down Expand Up @@ -1497,6 +1497,8 @@ my %mode_actions = (
remove_ltgt
encode_html_amp
approve_unicode )],
NOHTMLURL, [qw(
remove_tags )],
PLAINTEXT, [qw(
newline_to_local
diacritic_max
Expand Down Expand Up @@ -1627,6 +1629,7 @@ sub strip_extrans { stripByMode($_[0], EXTRANS, @_[1 .. $#_]) }
sub strip_html { stripByMode($_[0], HTML, @_[1 .. $#_]) }
sub strip_literal { stripByMode($_[0], LITERAL, @_[1 .. $#_]) }
sub strip_nohtml { stripByMode($_[0], NOHTML, @_[1 .. $#_]) }
sub strip_nohtmlurl { stripByMode($_[0], NOHTMLURL, @_[1 .. $#_]) }
sub strip_notags { stripByMode($_[0], NOTAGS, @_[1 .. $#_]) }
sub strip_plaintext { stripByMode($_[0], PLAINTEXT, @_[1 .. $#_]) }
sub strip_textarea { stripByMode($_[0], TEXTAREA, @_[1 .. $#_]) }
Expand Down Expand Up @@ -2765,7 +2768,7 @@ sub fudgeurl {
# Correction: NO entities belong in URLs. If they can't input the character, tough shit to them.
$url =~ s/&(.+?);//g;
# we don't like SCRIPT in a URL
$url = strip_nohtml($url);
$url = strip_nohtmlurl($url);
$url = $encoder->encode($url);
return $url;
}
Expand Down

0 comments on commit 4295440

Please sign in to comment.