diff options
author | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-07-13 12:45:54 +0000 |
---|---|---|
committer | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-07-13 12:45:54 +0000 |
commit | 94e9da6f6c654f45bc7efb7a4e6591c64f0553c5 (patch) | |
tree | 224c2739c6ae20cc72714139be5cd6f81745bb41 | |
parent | 892f6a866c149b3460d8c45a03706659d269129b (diff) |
Zero-padded VNDBIDs shouldn't match
git-svn-id: svn://vndb.org/vndb@68 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
-rw-r--r-- | data/tpl/defs.pl | 4 | ||||
-rw-r--r-- | lib/Multi/IRC.pm | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/data/tpl/defs.pl b/data/tpl/defs.pl index 47364193..039c6507 100644 --- a/data/tpl/defs.pl +++ b/data/tpl/defs.pl @@ -168,8 +168,8 @@ sub summary { # cmd, len, def if(!$as && s/(http|https):\/\/(.+[0-9a-zA-Z=\/])/<a href="$1:\/\/$2" rel="nofollow">link<\/a>/) { $l = 4; } elsif(!$as) { - s/^(.*[^\w]|)([tdvpr][0-9]+)\.([0-9]+)([^\w].*|)$/$1<a href="\/$2.$3">$2.$3<\/a>$4/ || - s/^(.*[^\w]|)([tduvpr][0-9]+)([^\w].*|)$/$1<a href="\/$2">$2<\/a>$3/; + s/^(.*[^\w]|)([tdvpr][1-9][0-9]*)\.([1-9][0-9]*)([^\w].*|)$/$1<a href="\/$2.$3">$2.$3<\/a>$4/ || + s/^(.*[^\w]|)([tduvpr][1-9][0-9]*)([^\w].*|)$/$1<a href="\/$2">$2<\/a>$3/; } while(s/\[\/url\]/<\/a>/i) { $l -= 6; diff --git a/lib/Multi/IRC.pm b/lib/Multi/IRC.pm index 708f4b06..e0a8b010 100644 --- a/lib/Multi/IRC.pm +++ b/lib/Multi/IRC.pm @@ -164,8 +164,8 @@ sub vndbid { # dest, msg my @id; # [ type, id, ref ] for (split /[, ]/, $m) { next if length > 15 or m{[a-z]{3,6}://}i; # weed out URLs and too long things - push @id, /^(?:.*[^\w]|)([dvprt])([0-9]+)\.([0-9]+)(?:[^\w].*|)$/ ? [ $1, $2, $3 ] # matches 2, 4 and 5 - : /^(?:.*[^\w]|)([dvprtu])([0-9]+)(?:[^\w].*|)$/ ? [ $1, $2, 0 ] : (); # matches 1 and 3 + push @id, /^(?:.*[^\w]|)([dvprt])([1-9][0-9]*)\.([1-9][0-9]*)(?:[^\w].*|)$/ ? [ $1, $2, $3 ] # matches 2, 4 and 5 + : /^(?:.*[^\w]|)([dvprtu])([1-9][0-9]*)(?:[^\w].*|)$/ ? [ $1, $2, 0 ] : (); # matches 1 and 3 } # loop through the matched IDs and search the database |