Skip to content
Browse files

Minor bugs from last revision

  • Loading branch information...
1 parent 082ca06 commit 2a2c3af89ad351eed19e961e58877323b1e00b23 @pudge pudge committed
View
11 CHANGES
@@ -43,9 +43,6 @@ slash-1.0.5, 2000.06.xx
* Fixed code to check if formkey for a submission is being
submitted by the IP address that it was initially created under
-* Changed the id column in formkeys to be "uid-$ENV{REMOTE_ADDR}"
- (was just uid) for logged in users
-
* New function Slash::errorMessage(), prints out whatever
argument it receives
@@ -98,9 +95,6 @@ slash-1.0.5, 2000.06.xx
to encode every character that is not safe or reserved,
according to RFC1738)
-* Changed formkey to be by uid for logged in users, IP address
- for everyone else
-
* Base deletions of newstories in dailyStuff on archive_delay
* Do stripByMode() of sig in users.pl after getting first 160
@@ -112,6 +106,11 @@ slash-1.0.5, 2000.06.xx
* Fixed search.pl in stripping of bad chars from query string
(Michael Sims)
+* Added submit_categories array to slashdotrc.pl, for adding
+ new categories to submissions (like Hold, Quik, etc.)
+
+* Fixed bad color of "Moderation totals" text in Slash.pm
+
* Plenty of minor code cleanups
View
17 Slash.pm
@@ -1335,9 +1335,12 @@ sub approveTag {
$tag =~ s/\bstyle\s*=(.*)$//i; # go away please
# Take care of URL:foo and other HREFs
- if ($tag =~ /^URL:(.+)$/i || $tag =~ /href\s*=(.+)$/i) {
+ if ($tag =~ /^URL:(.+)$/i) {
my $url = fixurl($1);
return qq!<A HREF="$url">$url</A>!;
+ } elsif ($tag =~ /href\s*=(.+)$/i) {
+ my $url = fixurl($1);
+ return qq!<A HREF="$url">!;
}
# Validate all other tags
@@ -1356,7 +1359,7 @@ sub fixurl {
$url =~ s/([^\w.+!*'(),;?:@=&a-zA-Z0-9\$\/-])/sprintf "%%%02X", ord $1/ge;
$url = fixHref($url) || $url;
my $decoded_url = decode_entities($url);
- return undef if $decoded_url =~ s|^\s*\w+script\b.*$||i;
+ return $decoded_url =~ s|^\s*\w+script\b.*$||i ? undef : $url;
}
########################################################
@@ -1544,6 +1547,7 @@ sub header {
<HTML><HEAD><TITLE>$title</TITLE>
EOT
+ # ssi = 1 IS NOT THE SAME as ssi = 'yes'
if ($I{F}{ssi} eq 'yes') {
ssiHead($section);
return;
@@ -2056,7 +2060,7 @@ EOT
$c->finish;
return unless $reasonTotal;
- print qq!<FONT COLOR="$I{fg}[3]"><B>Moderation Totals</B></FONT>:!;
+ print qq!<FONT COLOR="$I{bg}[3]"><B>Moderation Totals</B></FONT>:!;
foreach (0 .. @reasonHist) {
print "$I{reasons}->[$_]=$reasonHist[$_], " if $reasonHist[$_];
}
@@ -2662,11 +2666,11 @@ sub getFormkeyId {
if ($I{query}->param('rlogin') && length($I{F}{upasswd}) > 1) {
# id includes '&' to prevent uid's and IPs
# from potentially being the same
- $id = '-1&' . $ENV{REMOTE_ADDR};
+ $id = '-1-' . $ENV{REMOTE_ADDR};
} elsif ($uid > 0) {
$id = $uid;
} else {
- $id = '-1&' . $ENV{REMOTE_ADDR};
+ $id = '-1-' . $ENV{REMOTE_ADDR};
}
return($id);
}
@@ -2838,7 +2842,8 @@ sub checkSubmission {
my($last_submitted) = sqlSelect(
"max(submit_ts)",
"formkeys",
- "id = '$id' AND formname = '$formname'") || 0;
+ "id = '$id' AND formname = '$formname'");
+ $last_submitted ||= 0;
my $interval = time() - $last_submitted;
View
2 plugins/PollBooth/pollBooth.pl
@@ -157,7 +157,7 @@ sub savepoll {
} else {
$I{dbh}->do("DELETE from pollanswers WHERE
- qid=" . $I{dbh}->quote($qid) . " and aid=$x");
+ qid=" . $I{dbh}->quote($I{F}{qid}) . " and aid=$x");
}
}
}
View
2 public_html/pollBooth.pl
@@ -157,7 +157,7 @@ sub savepoll {
} else {
$I{dbh}->do("DELETE from pollanswers WHERE
- qid=" . $I{dbh}->quote($qid) . " and aid=$x");
+ qid=" . $I{dbh}->quote($I{F}{qid}) . " and aid=$x");
}
}
}
View
4 public_html/users.pl
@@ -775,8 +775,8 @@ sub saveUser {
eliminates them, you are using a browser that doesn't support them, or you rejected it.
EOT
- # stripByMode _after_ fitting sig into schema, 160 chars
- $I{F}{sig} = stripByMode(substr($I{F}{sig}, 0, 160), 'html');
+ # stripByMode _after_ fitting sig into schema, 120 chars
+ $I{F}{sig} = stripByMode(substr($I{F}{sig}, 0, 120), 'html');
$I{F}{fakeemail} = stripByMode($I{F}{fakeemail});
$I{F}{homepage} = "" if $I{F}{homepage} eq "http://";
$I{F}{homepage} = stripByMode($I{F}{homepage});
View
4 slashd
@@ -260,7 +260,7 @@ sub sectionHeaders {
my $section = shift;
local *FH;
- $I{F}{ssi} = 'yes';
+ $I{F}{ssi} = 1;
open FH,">$I{basedir}/$section/slashhead.inc"
or die "Can't open $I{basedir}/$section/slashhead.inc: $!";
*STDOUT = *FH;
@@ -274,7 +274,7 @@ sub sectionHeaders {
footer();
close FH;
- $I{F}{ssi} = 'yes';
+ $I{F}{ssi} = 1;
open FH, ">$I{basedir}/$section/slashhead_F.inc"
or die "Can't open $I{basedir}/$section/slashhead_F.inc: $!";
*STDOUT = *FH;
View
2 themes/slashcode/htdocs/pollBooth.pl
@@ -157,7 +157,7 @@ sub savepoll {
} else {
$I{dbh}->do("DELETE from pollanswers WHERE
- qid=" . $I{dbh}->quote($qid) . " and aid=$x");
+ qid=" . $I{dbh}->quote($I{F}{qid}) . " and aid=$x");
}
}
}
View
4 themes/slashcode/htdocs/users.pl
@@ -775,8 +775,8 @@ sub saveUser {
eliminates them, you are using a browser that doesn't support them, or you rejected it.
EOT
- # stripByMode _after_ fitting sig into schema, 160 chars
- $I{F}{sig} = stripByMode(substr($I{F}{sig}, 0, 160), 'html');
+ # stripByMode _after_ fitting sig into schema, 120 chars
+ $I{F}{sig} = stripByMode(substr($I{F}{sig}, 0, 120), 'html');
$I{F}{fakeemail} = stripByMode($I{F}{fakeemail});
$I{F}{homepage} = "" if $I{F}{homepage} eq "http://";
$I{F}{homepage} = stripByMode($I{F}{homepage});

0 comments on commit 2a2c3af

Please sign in to comment.
Something went wrong with that request. Please try again.