Allow mixed case vgift tags.
Patch by kareila.
diffs (32 lines):
diff -r 690e8610d403 -r fed283ba3487 cgi-bin/DW/VirtualGift.pm
--- a/cgi-bin/DW/VirtualGift.pm Sat Oct 30 11:45:56 2010 +0800
+++ b/cgi-bin/DW/VirtualGift.pm Sat Oct 30 11:50:16 2010 +0800
@@ -32,6 +32,7 @@ sub _memcache_stored_props { return ( '1
# end MemCacheable methods ###############################
use Digest::MD5 qw/ md5_hex /;
+use LJ::Constants;
use LJ::Event::VgiftApproved;
@@ -262,8 +263,18 @@ sub tags {
$self->_tagwipe;
return wantarray ? () : [];
}
- my @valid_tags = LJ::validate_interest_list( @newtags );
- my %invalid_tags = map { lc( $_ ) => 1 } @newtags;
+
+ # make sure the tags we've specified are valid
+ my @valid_tags;
+ foreach my $tag ( @newtags ) {
+ my ( $bytes, $chars ) = LJ::text_length( $tag );
+ next if $bytes > LJ::BMAX_SITEKEYWORD;
+ next if $chars > LJ::CMAX_SITEKEYWORD;
+ next if $tag =~ /[\<\>]/;
+ push @valid_tags, $tag;
+ }
+
+ my %invalid_tags = map { $_ => 1 } @newtags;
delete @invalid_ta...@valid_tags};
if ( %invalid_tags ) {
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog