1Uncaptcha.URLBlock(3kaya)    Kaya module reference   Uncaptcha.URLBlock(3kaya)
2
3
4

NAME

6       Uncaptcha::URLBlock - A URL-based filter
7

SYNOPSIS

9       Uncaptcha::URLBlock< >
10
11
12     = URLBlock(Int maxurls,[String] fields,Bool rejectmixed)
13

DESCRIPTION

15       This  filter  rejects submissions which contain too many URLs. For many
16       spambots, the aim is to submit as many forms as possible  in  the  hope
17       that the content of the form will be placed on the web and links in the
18       content will then temporarily boost the search ranking of pages for the
19       spammers.
20
21       By rejecting submissions with excessive URLs (or any URLs, if appropri‐
22       ate) spam is made significantly harder.
23
24       maxurls is the maximum number of URLs expected in  legitimate  content.
25       This  can generally be set relatively low, and in many applications can
26       safely be set to zero (which means any URLs at all will cause the  con‐
27       tent to be rejected.
28
29       fields  is  a list of the field names in the previous form which should
30       be subjected to this check. In some cases, you may wish  to  call  this
31       check more than once, with different fields and maxurls settings.
32
33       rejectmixed  causes  immediate rejection of a form where the same field
34       contains two URLs of different 'types'. Software on the web has differ‐
35       ent  ways  of  processing  legitimate URLs in submissions - it may turn
36       plain URLs into links, or expect HTML to be used, or  use  BBCode,  for
37       example.  Generally  legitimate users do not mix URL formats in submis‐
38       sions, but generic spambots may do so.
39
40
41    // in the form handling function
42        if (checkURLBlock(URLBlock(3,["commenttext"],true)) &&
43            checkURLBlock(URLBlock(0,["subject","name","email"],true)) {
44            // process form or do further checks
45        } else {
46            // reject form, perhaps with an error message
47        }
48    // this checks that the "commenttext" field has no more than
49    // three URLs and that other fields have none at all.
50

AUTHORS

52       Kaya  standard  library  by  Edwin  Brady,  Chris  Morris  and   others
53       (kaya@kayalang.org). For further information see http://kayalang.org/
54

LICENSE

56       The  Kaya  standard  library  is free software; you can redistribute it
57       and/or modify it under the terms  of  the  GNU  Lesser  General  Public
58       License  (version  2.1  or  any later version) as published by the Free
59       Software Foundation.
60
62       Uncaptcha.checkURLBlock (3kaya)
63
64
65
66Kaya                             December 2010       Uncaptcha.URLBlock(3kaya)
Impressum