Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Anchor sids

  • Loading branch information...
commit fda1c295ac0f45938e48f57f40605cb2dc8033cc 1 parent 3e4e3c1
@pudge pudge authored
View
2  Slash/DB/MySQL/MySQL.pm
@@ -8749,7 +8749,7 @@ sub getStoidFromSidOrStoid {
sub getStoidFromSid {
my($self, $sid) = @_;
return undef if !$sid;
- return undef if $sid !~ regexSid();
+ return undef if $sid !~ regexSid(1);
if (my $stoid = $self->{_sid_conversion_cache}{$sid}) {
return $stoid;
}
View
4 Slash/Utility/Data/Data.pm
@@ -174,7 +174,9 @@ sub nick2matchname {
# NOTE: sid is also used for discussion ID (and maybe stoid too?),
# such as in comments.pl, so that's what the \d{1,8} is for. -- pudge
sub regexSid {
- return qr{\b(\d{2}/\d{2}/\d{2}/\d{3,8}|\d{1,8})\b};
+ my $anchor = shift;
+ my $sid = '(\d{2}/\d{2}/\d{2}/\d{3,8}|\d{1,8})';
+ return $anchor ? qr{^$sid$} : qr{\b$sid\b};
}
#========================================================================
View
2  Slash/Utility/Environment/Environment.pm
@@ -1871,7 +1871,7 @@ Hashref of cleaned-up data.
logtoken => sub { $_[0] = '' unless
$_[0] =~ m|^\d+::[A-Za-z0-9]{22}$| },
sid => sub { $_[0] = '' unless
- $_[0] =~ Slash::Utility::Data::regexSid() },
+ $_[0] =~ Slash::Utility::Data::regexSid(1) },
flags => sub { $_[0] =~ s|[^a-z0-9_,]||g },
query => sub { $_[0] =~ s|[\000-\040<>\177-\377]+| |g;
$_[0] =~ s|\s+| |g; },
View
2  plugins/Stats/Stats.pm
@@ -1347,7 +1347,7 @@ sub countDailyStoriesAccessRSS {
"op='slashdot-it' AND query_string LIKE '%from=rssbadge'",
'GROUP BY query_string');
my $sid_hr = { };
- my $regex_sid = regexSid();
+ my $regex_sid = regexSid(1);
for my $qs (keys %$qs_hr) {
my($sid) = $qs =~ m{sid=\b([\d/]+)\b};
next unless $sid =~ $regex_sid;

0 comments on commit fda1c29

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