Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pudge committed Nov 21, 2000
1 parent f494b3c commit 41bfa30
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 17 deletions.
12 changes: 3 additions & 9 deletions Slash.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1390,20 +1390,14 @@ sub fixparam {
sub fixurl { sub fixurl {
my($url, $parameter) = @_; my($url, $parameter) = @_;


# RFC 2396
my $mark = quotemeta(q"-_.!~*'()");
my $alphanum = 'a-zA-Z0-9';
my $unreserved = $alphanum . $mark;
my $reserved = quotemeta(';|/?:@&=+$,');
my $extra = quotemeta('%#');

if ($parameter) { if ($parameter) {
$url =~ s/([^$unreserved])/sprintf "%%%02X", ord $1/ge; $url =~ s/([^$URI::unreserved])/$URI::Escape::escapes{$1}/oge;
return $url; return $url;
} else { } else {
$url =~ s/[" ]//g; $url =~ s/[" ]//g;
$url =~ s/^'(.+?)'$/$1/g; $url =~ s/^'(.+?)'$/$1/g;
$url =~ s/([^$unreserved$reserved$extra])/sprintf "%%%02X", ord $1/ge; # add '#' to allowed characters
$url =~ s/([^$URI::uric#])/$URI::Escape::escapes{$1}/oge;
$url = fixHref($url) || $url; $url = fixHref($url) || $url;
my $decoded_url = decode_entities($url); my $decoded_url = decode_entities($url);
return $decoded_url =~ s|^\s*\w+script\b.*$||i ? undef : $url; return $decoded_url =~ s|^\s*\w+script\b.*$||i ? undef : $url;
Expand Down
10 changes: 8 additions & 2 deletions plugins/Submit/submit.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use lib '../'; use lib '../';
use vars '%I'; use vars '%I';
use Slash; use Slash;
use URI;


################################################################# #################################################################
sub main { sub main {
Expand Down Expand Up @@ -143,8 +144,13 @@ sub previewForm {


$introtext =~ s/\n\n/\n<P>/gi; $introtext =~ s/\n\n/\n<P>/gi;
$introtext .= " "; $introtext .= " ";
$introtext =~ s{(?<!"|=|>)(http|ftp|gopher|telnet)://(.*?)(\W\s)?[\s]} $introtext =~ s{(?<!["=>])(http|ftp|gopher|telnet)://([$URI::uric#]+)}{
{<A HREF="$1://$2">$1://$2</A> }gi; my($proto, $url) = ($1, $2);
my $extra = '';
$extra = ',' if $url =~ s/,$//;
$extra = ')' . $extra if $url !~ /\(/ && $url =~ s/\)$//;
qq[<A HREF="$proto://$url">$proto://$url</A>$extra];
}ogie;
$introtext =~ s/\s+$//; $introtext =~ s/\s+$//;
$introtext = qq!<I>"$introtext"</I>! if $name; $introtext = qq!<I>"$introtext"</I>! if $name;


Expand Down
2 changes: 1 addition & 1 deletion public_html/metamod.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ sub metaModerate {


print "<BR><BR>" if $y && $I{U}{aseclev} > 10; # Break HTML properly. print "<BR><BR>" if $y && $I{U}{aseclev} > 10; # Break HTML properly.
print <<EOT; print <<EOT;
$y comments have been meta moderated. Thanks for participating. $y moderations have been meta moderated. Thanks for participating.
You may wanna go back <A HREF="$I{rootdir}/">home</A> or perhaps to You may wanna go back <A HREF="$I{rootdir}/">home</A> or perhaps to
<A HREF="$I{rootdir}/users.pl">your user page</A>. <A HREF="$I{rootdir}/users.pl">your user page</A>.
EOT EOT
Expand Down
10 changes: 8 additions & 2 deletions public_html/submit.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use lib '../'; use lib '../';
use vars '%I'; use vars '%I';
use Slash; use Slash;
use URI;


################################################################# #################################################################
sub main { sub main {
Expand Down Expand Up @@ -143,8 +144,13 @@ sub previewForm {


$introtext =~ s/\n\n/\n<P>/gi; $introtext =~ s/\n\n/\n<P>/gi;
$introtext .= " "; $introtext .= " ";
$introtext =~ s{(?<!"|=|>)(http|ftp|gopher|telnet)://(.*?)(\W\s)?[\s]} $introtext =~ s{(?<!["=>])(http|ftp|gopher|telnet)://([$URI::uric#]+)}{
{<A HREF="$1://$2">$1://$2</A> }gi; my($proto, $url) = ($1, $2);
my $extra = '';
$extra = ',' if $url =~ s/,$//;
$extra = ')' . $extra if $url !~ /\(/ && $url =~ s/\)$//;
qq[<A HREF="$proto://$url">$proto://$url</A>$extra];
}ogie;
$introtext =~ s/\s+$//; $introtext =~ s/\s+$//;
$introtext = qq!<I>"$introtext"</I>! if $name; $introtext = qq!<I>"$introtext"</I>! if $name;


Expand Down
2 changes: 1 addition & 1 deletion themes/slashcode/htdocs/metamod.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ sub metaModerate {


print "<BR><BR>" if $y && $I{U}{aseclev} > 10; # Break HTML properly. print "<BR><BR>" if $y && $I{U}{aseclev} > 10; # Break HTML properly.
print <<EOT; print <<EOT;
$y comments have been meta moderated. Thanks for participating. $y moderations have been meta moderated. Thanks for participating.
You may wanna go back <A HREF="$I{rootdir}/">home</A> or perhaps to You may wanna go back <A HREF="$I{rootdir}/">home</A> or perhaps to
<A HREF="$I{rootdir}/users.pl">your user page</A>. <A HREF="$I{rootdir}/users.pl">your user page</A>.
EOT EOT
Expand Down
10 changes: 8 additions & 2 deletions themes/slashcode/htdocs/submit.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use lib '../'; use lib '../';
use vars '%I'; use vars '%I';
use Slash; use Slash;
use URI;


################################################################# #################################################################
sub main { sub main {
Expand Down Expand Up @@ -143,8 +144,13 @@ sub previewForm {


$introtext =~ s/\n\n/\n<P>/gi; $introtext =~ s/\n\n/\n<P>/gi;
$introtext .= " "; $introtext .= " ";
$introtext =~ s{(?<!"|=|>)(http|ftp|gopher|telnet)://(.*?)(\W\s)?[\s]} $introtext =~ s{(?<!["=>])(http|ftp|gopher|telnet)://([$URI::uric#]+)}{
{<A HREF="$1://$2">$1://$2</A> }gi; my($proto, $url) = ($1, $2);
my $extra = '';
$extra = ',' if $url =~ s/,$//;
$extra = ')' . $extra if $url !~ /\(/ && $url =~ s/\)$//;
qq[<A HREF="$proto://$url">$proto://$url</A>$extra];
}ogie;
$introtext =~ s/\s+$//; $introtext =~ s/\s+$//;
$introtext = qq!<I>"$introtext"</I>! if $name; $introtext = qq!<I>"$introtext"</I>! if $name;


Expand Down

0 comments on commit 41bfa30

Please sign in to comment.