Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor fixes

  • Loading branch information...
commit 41bfa30e245a9fe687f2e8bdfa5b448d8214b99e 1 parent f494b3c
@pudge pudge authored
View
12 Slash.pm
@@ -1390,20 +1390,14 @@ sub fixparam {
sub fixurl {
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) {
- $url =~ s/([^$unreserved])/sprintf "%%%02X", ord $1/ge;
+ $url =~ s/([^$URI::unreserved])/$URI::Escape::escapes{$1}/oge;
return $url;
} else {
$url =~ s/[" ]//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;
my $decoded_url = decode_entities($url);
return $decoded_url =~ s|^\s*\w+script\b.*$||i ? undef : $url;
View
10 plugins/Submit/submit.pl
@@ -28,6 +28,7 @@
use lib '../';
use vars '%I';
use Slash;
+use URI;
#################################################################
sub main {
@@ -143,8 +144,13 @@ sub previewForm {
$introtext =~ s/\n\n/\n<P>/gi;
$introtext .= " ";
- $introtext =~ s{(?<!"|=|>)(http|ftp|gopher|telnet)://(.*?)(\W\s)?[\s]}
- {<A HREF="$1://$2">$1://$2</A> }gi;
+ $introtext =~ s{(?<!["=>])(http|ftp|gopher|telnet)://([$URI::uric#]+)}{
+ 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 = qq!<I>"$introtext"</I>! if $name;
View
2  public_html/metamod.pl
@@ -131,7 +131,7 @@ sub metaModerate {
print "<BR><BR>" if $y && $I{U}{aseclev} > 10; # Break HTML properly.
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
<A HREF="$I{rootdir}/users.pl">your user page</A>.
EOT
View
10 public_html/submit.pl
@@ -28,6 +28,7 @@
use lib '../';
use vars '%I';
use Slash;
+use URI;
#################################################################
sub main {
@@ -143,8 +144,13 @@ sub previewForm {
$introtext =~ s/\n\n/\n<P>/gi;
$introtext .= " ";
- $introtext =~ s{(?<!"|=|>)(http|ftp|gopher|telnet)://(.*?)(\W\s)?[\s]}
- {<A HREF="$1://$2">$1://$2</A> }gi;
+ $introtext =~ s{(?<!["=>])(http|ftp|gopher|telnet)://([$URI::uric#]+)}{
+ 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 = qq!<I>"$introtext"</I>! if $name;
View
2  themes/slashcode/htdocs/metamod.pl
@@ -131,7 +131,7 @@ sub metaModerate {
print "<BR><BR>" if $y && $I{U}{aseclev} > 10; # Break HTML properly.
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
<A HREF="$I{rootdir}/users.pl">your user page</A>.
EOT
View
10 themes/slashcode/htdocs/submit.pl
@@ -28,6 +28,7 @@
use lib '../';
use vars '%I';
use Slash;
+use URI;
#################################################################
sub main {
@@ -143,8 +144,13 @@ sub previewForm {
$introtext =~ s/\n\n/\n<P>/gi;
$introtext .= " ";
- $introtext =~ s{(?<!"|=|>)(http|ftp|gopher|telnet)://(.*?)(\W\s)?[\s]}
- {<A HREF="$1://$2">$1://$2</A> }gi;
+ $introtext =~ s{(?<!["=>])(http|ftp|gopher|telnet)://([$URI::uric#]+)}{
+ 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 = qq!<I>"$introtext"</I>! if $name;
Please sign in to comment.
Something went wrong with that request. Please try again.