summaryrefslogtreecommitdiff
path: root/lib/VNDBUtil.pm
AgeCommit message (Collapse)AuthorFilesLines
2020-04-06Release::Edit: Consider GTIN code as a string for validation/editingYorhel1-0/+1
Problem is that the 'uint' validation does not allow leading zeros, which are very valid as part of GTIN codes, thus resulting in an error when validating a normalized GTIN code.
2018-10-29Add U+201C to search normalize removalalto1-1/+1
2018-08-01Also normalize Turkish ı in VN searchYorhel1-0/+1
This also handles the uppercase İ, as that is already converted to lowercase ı in an earlier step.
2018-07-14Some VN search normalization improvementsYorhel1-9/+9
https://vndb.org/t2520.265 - 270.
2018-01-12Don't allow unlikely short GTIN codesYorhel1-0/+1
Should fix https://vndb.org/t2520.237
2018-01-06Rewrite bb2html() to be more flexibleYorhel1-142/+1
This is based on the API that I described in https://vndb.org/t5564.12 It's mostly bug-compatible with the old bb2html(), main differences: - <br /> -> <br> for no reason - Doesn't sporadically add a wrong </div> - $rmwhitespace now also after [/code] Most of the test cases were contributed by flan <flan@flande.re>
2016-01-16VNDBUtil: Consider 'wo' and 'o' the same in search normalizationYorhel1-1/+9
2015-10-11VNDBUtil: Add some tildes to VN search normalizationYorhel1-1/+1
2015-10-01VN search: Add some more quote characters + & to normalizationYorhel1-1/+2
As suggested by https://vndb.org/t2520.168
2015-01-28Merge branch 'staff' into masterYorhel1-1/+4
Conflicts: lib/VNDB/DB/VN.pm lib/VNDB/Handler/VNPage.pm
2015-01-27staff: Fix various parts to recognize the new staff databasemorkt1-2/+2
2014-12-22DB: Merge name/title fetching in main fetching functionsYorhel1-0/+3
And call bbSubstLinks() from Handler::Discussions rather than DB::Discussions - it's not a transformation that the DB layer should do, IMO.
2014-12-22bbcode: Replace [vcpgi][0-9]+ links with a [url] tagmorkt1-1/+1
Patch from https://vndb.org/t5564.13
2014-09-15norm_ip: Use /23 subnet for IPv4Yorhel1-7/+12
Apparently there are networks where a single visitor is assigned random addresses in the /23 range for each request. This should fix the login/registration form on such networks, and makes the login throttling more robust (and easier to trigger for innocent people, but judging from monitoring the throttle table, failed logins arent that common). I wonder if /23 is enough, but we'll see.
2014-09-02Fix matching bug in norm_ip()Yorhel1-1/+1
The . match doesn't match "any byte". Without the /s flag, it doesn't match newline characters.
2014-08-29API: Make sure to honor the new login throttleYorhel1-1/+20
2012-07-16VNDBUtil::bb2html(): Added support for dx.x.x linksSpaceRanger1-8/+10
Original patch of SpaceRanger @ http://p.blicky.net/34qcy I took the liberty of making minor changes to limit the longid match to dx.x.x and to compact the code a bit.
2011-05-17Bugfix: Properly make i+ IDs linkable in bb2html()Yorhel1-2/+2
2011-04-08Toggle [spoiler] tag visibility with global setting rather than mouse-overYorhel1-4/+4
2011-02-19chardb: Made bb2html() and Multi::IRC aware of c+, c+.+ and i+Yorhel1-2/+2
2011-01-27TUWF: Use the uri_escape() provided by TUWFYorhel1-10/+1
2010-12-19VNDBUtil::bb2html(): Fixed bug with lowercasing all [url=..] URLsYorhel1-2/+2
2010-12-16VNDBUtil::bb2html(): Fixed bug when the string starts with a VNDBIDYorhel1-1/+1
2010-12-14VNDBUtil: Consider "senpai" and "sempai" the same in the VN searchYorhel1-0/+1
2010-12-09Write VNDBUtil::uri_escape() and removed dependency on URI::EscapeYorhel1-1/+11
Its functionality is too simpel to require it as a special dependency, seriously.
2010-11-27VNDBUtil: Fixed minor bug in bb2html() and small cleanupYorhel1-11/+15
Unknown/incorrect tags should be outputted as-is, as was the case with the previous implementation. Also cleaned up the id and exid if statement to be slightly shorter.
2010-11-26VNDBUtil: Partly rewrote bb2html() to be faster and betterYorhel1-52/+71
It does not use split() anymore, the input string is parsed in a single pass using a global regex. It's now a lot faster on larger input. The page generation time of /t937 went back from ~350ms to ~55ms (on the beta, the production server is slower). Also made several tiny improvements while I was at it: - multiple successive newlines aren't removed within [code] - truncating a message with $maxlength also removes trailing spaces and interpunction - multiple successive spaces are removed outside of [code] (and thus don't count towards the length of the message) The function should be mostly equivalent in regards to all other things, ignoring a few minor border cases that weren't documented in the first place. The URL regex (and the idea of a global regex) came from bpaste: http://g.blicky.net/bpaste.git/commit/?id=ac7b16d0ec0f195d00a0a79698f67c3010e8cf7d
2010-11-03Lowered minimum search query word to 2 charactersYorhel1-1/+1
Searching for "ef" isn't really fun with all those results, this makes it slightly less broad.
2010-11-03Merge branch 'master' into betaYorhel1-4/+4
Conflicts: lib/VNDB/DB/VN.pm lib/VNDB/Func.pm
2010-11-02Handler::(Misc|VNPage): Added HTML width/height to screenshot thumbnailsYorhel1-1/+1
And made sure the dimensions are truncated in VNDBUtil::imgsize(). Setting the width/height attributes makes sure that the browser can reserve space for the image when it hasn't been loaded yet, which prevents the overall page layout from changing while the images are loading. (which is annoying if your connection isn't all that fast)
2010-11-02Multi::Image: Abstracted image dimension calculation into VNDBUtilYorhel1-1/+18
Which may also be useful for other scripts.
2010-10-31VNDBUtil::normalize: Added search alias for 'fandisk'Yorhel1-0/+2
2010-03-13Improved VN searchYorhel1-0/+202
This adds a new column to the vn table: c_search, which holds the normalized titles for speedy search results using LIKE. Also split some functions from VNDB::Func that didn't require YAWF into a VNDBUtil module, so Multi can also make use of them. The normalization functions are the same for Multi and VNDB, after all. The API and Multi::IRC still use the old search, these should be updated as well.