PageSourceSearch

https://georgeeliot.org/plugins/system/cleantalkantispam/js/ct-external.js?1790928359

js georgeeliot.org collected 2026-10-02 08:07:25 UTC 3,009 bytes, 95 lines download raw bytes

1function ct_check_external(){
2    
3    for(var i = 0, host = '', action = ''; i < document.forms.length; i++){
4        var form = document.forms[i];
5
6        if( typeof(form.action) == 'string' ) {
7
8            //skip excluded forms
9            if ( formIsExclusion(form)) {
10                return;
11            }
12
13            action = document.forms[i].action;
14            if( action.indexOf('http://') != -1 || action.indexOf('https://') != -1 ){
15
16                tmp  = action.split('//');
17                tmp  = tmp[1].split('/');
18                host = tmp[0].toLowerCase();
19
20                if( host != location.hostname.toLowerCase()){
21                    var ct_action = document.createElement("input");
22                    ct_action.name='ct_action';
23                    ct_action.value=action;
24                    ct_action.type='hidden';
25                    document.forms[i].appendChild(ct_action);
26
27                    var ct_method = document.createElement("input");
28                    ct_method.name='ct_method';
29                    ct_method.value=document.forms[i].method;
30                    ct_method.type='hidden';
31                    document.forms[i].appendChild(ct_method);
32
33                    document.forms[i].method = 'POST';
34
35                    if (!window.location.origin){
36                        window.location.origin = window.location.protocol + "//" + window.location.hostname;
37                    }
38                    document.forms[i].action = window.location.origin;
39                }
40            }
41        }
42    }
43}
44
45document.addEventListener('DOMContentLoaded', function() {
46    setTimeout(function () {
47        ct_check_external();
48    }, 1500);
49});
50
51function formIsExclusion(currentForm)
52{
53    let exclusions_by_id = [
54    ]
55
56    let exclusions_by_role = [
57    ]
58
59    let exclusions_by_class = [
60    ]
61
62    let result = false
63
64    try {
65        action = currentForm.action;
66        if (action.indexOf('cloudbeds.com') != -1) {
67            result = true;
68        }
69
70        exclusions_by_id.forEach(function (exclusion_id) {
71            const form_id = currentForm.getAttribute('id')
72            if ( form_id !== null && typeof (form_id) !== 'undefined' && form_id.indexOf(exclusion_id) !== -1 ) {
73                result = true
74            }
75        })
76
77        exclusions_by_class.forEach(function (exclusion_class) {
78            const form_class = currentForm.getAttribute('class')
79            if ( form_class !== null && typeof form_class !== 'undefined' && form_class.indexOf(exclusion_class) !== -1 ) {
80                result = true
81            }
82        })
83
84        exclusions_by_role.forEach(function (exclusion_role) {
85            const form_role = currentForm.getAttribute('id')
86            if ( form_role !== null && typeof form_role !== 'undefined'&& form_role.indexOf(exclusion_role) !== -1 ) {
87                result = true
88            }
89        })
90    } catch (e) {
91        console.table('APBCT ERROR: formIsExclusion() - ',e)
92    }
93
94    return result
95}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.