View | Details | Raw Unified | Return to bug 34478
Collapse All | Expand All

(-)a/csrf_get.pl (+56 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
use Modern::Perl;
4
use File::Find;
5
use File::Slurp;
6
use Data::Dumper;
7
8
my @themes;
9
10
# OPAC themes
11
my $opac_dir  = 'koha-tmpl/opac-tmpl';
12
opendir ( my $dh, $opac_dir ) or die "can't opendir $opac_dir: $!";
13
for my $theme ( grep { not /^\.|lib|js|xslt/ } readdir($dh) ) {
14
    push @themes, "$opac_dir/$theme/en";
15
}
16
close $dh;
17
18
# STAFF themes
19
my $staff_dir = 'koha-tmpl/intranet-tmpl';
20
opendir ( $dh, $staff_dir ) or die "can't opendir $staff_dir: $!";
21
for my $theme ( grep { not /^\.|lib|js/ } readdir($dh) ) {
22
    push @themes, "$staff_dir/$theme/en";
23
}
24
close $dh;
25
26
my @files;
27
sub wanted {
28
    my $name = $File::Find::name;
29
    push @files, $name
30
        if $name =~ m[\.(tt|inc)$] and -f $name;
31
}
32
33
find({ wanted => \&wanted, no_chdir => 1 }, @themes );
34
35
my @errors;
36
for my $file ( @files ) {
37
    my @e = get_forms($file);
38
    push @errors, { file => $file, errors => \@e } if @e;
39
}
40
41
say sprintf("%s:%s",  $_->{file}, join(',', @{$_->{errors}})) for @errors;
42
43
sub get_forms {
44
    my ( $file ) = @_;
45
46
    my @lines = read_file($file);
47
    my @errors;
48
    return @errors unless grep { $_ =~ m|<form| } @lines;
49
    my $line = 0 ;
50
    for my $l (@lines) {
51
        $line++;
52
        next if ! ( $l =~ m{<form} && $l =~ m{method=('|")get('|")} );
53
        push @errors, $line;
54
    }
55
    return @errors;
56
}
(-)a/csrf_get.txt (-1 / +150 lines)
Line 0 Link Here
0
- 
1
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt:76
2
=> stateless
3
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt:338
4
=> stateless
5
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt:68
6
=> modified, there is 'op'
7
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt:63
8
=> stateless
9
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt:12
10
=> stateless
11
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt:79
12
=> stateless
13
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt:85
14
=> stateless
15
281
16
=> stateless
17
349
18
=> ??? Are we emptying the cart here ???
19
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt:87
20
=> stateless
21
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt:158
22
=> stateless
23
543
24
=> ??? Not clear ???
25
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt:38
26
=> modified, there is 'op'
27
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt:251
28
=> modified, there is 'op'
29
549
30
=> modified, there is 'op'
31
766
32
=> modified, there is 'op'
33
781
34
=> modified, there is 'op'
35
koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc:121
36
=> modified, there is 'op'
37
koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc:172
38
=> stateless
39
koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc:6
40
=> stateless
41
koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt:40
42
=> modified, there is 'op'
43
169
44
=> TODO there no 'op' here
45
koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt:
46
41
47
=> modified, there is 'op'
48
172
49
=> stateless
50
koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt:38
51
=> modified, there is 'op'
52
koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-profile.tt:49
53
=> modified, there is 'op'
54
koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-layout.tt:46
55
=> modified, there is 'op'
56
koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-template.tt:49
57
=> modified, there is 'op'
58
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt:539
59
=> TODO! Confusing code here!
60
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt:41
61
=> stateless
62
koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt:133
63
=> stateless
64
143
65
=> stateless
66
186
67
=> stateless
68
256
69
=> stateless
70
koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt:159
71
=> stateless
72
73
.TO BE CONTINUED.
74
75
koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt:426
76
koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt:423
77
koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt:146
78
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt:422,435
79
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt:151,207
80
koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt:286
81
koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt:195
82
koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt:71
83
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt:154
84
koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt:293,361
85
koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt:33
86
koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt:296
87
koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt:252
88
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt:230,294
89
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt:80
90
koha-tmpl/intranet-tmpl/prog/en/modules/admin/desks.tt:156
91
koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt:193
92
koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt:67
93
=> stateless
94
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt:393,397
95
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt:840,845,850
96
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt:258
97
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt:47,91
98
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt:152,182
99
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_686a.tt:14
100
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt:20
101
koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt:1001
102
koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt:16
103
koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt:41
104
koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt:58,212,267,325
105
koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt:50
106
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/vendor_issues.tt:140
107
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/transferorder.tt:24
108
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt:128,146,154,835,860
109
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt:363,365,403,404,405,406,409
110
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt:150,323
111
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edi_ean.tt:31
112
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt:60,140,199
113
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt:234
114
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt:304
115
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt:45
116
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt:1083
117
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt:173
118
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt:377,414,438,759,765
119
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-frequencies.tt:122,128
120
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt:263,269
121
koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt:33
122
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt:70
123
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tt:13
124
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt:360,370,375
125
koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt:172
126
koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt:28
127
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt:410,415,420,968,1001,1405
128
koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt:138
129
koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt:272
130
koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt:132,502
131
koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt:93
132
koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt:65
133
koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt:137
134
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt:63
135
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-template.tt:46
136
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-profile.tt:47
137
koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt:51
138
koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt:71,261,339
139
koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc:223
140
koha-tmpl/intranet-tmpl/prog/en/includes/erm-search.inc:6,18,30,42
141
koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc:8
142
koha-tmpl/intranet-tmpl/prog/en/includes/serials-advsearch.inc:3
143
koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-add-to-basket.inc:6
144
koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc:76,103,130,155
145
koha-tmpl/intranet-tmpl/prog/en/includes/suggestions-add-search.inc:7
146
koha-tmpl/intranet-tmpl/prog/en/includes/serials-search.inc:6
147
koha-tmpl/intranet-tmpl/prog/en/includes/catalogue-search-box.inc:10
148
koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc:3
149
koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc:106,152
150
koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc:78

Return to bug 34478