https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42585

--- Comment #5 from Kyle M Hall (khall) <[email protected]> ---
Created attachment 203793
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203793&action=edit
Bug 42585: Add safety analyzers

Koha won't run a saved report that fails its is_sql_valid whitelist,
but the librarian doesn't find out until they click Run and the report
errors out.

This patch adds three checks that surface the same problems while the
SQL is being written: forbidden_statement, missing_select and
forbidden_column.

Test Plan:
1) Apply this patch
2) prove t/Koha/Reports/Analyzer/Check/Safety/ \
         t/db_dependent/Koha/Reports/Analyzer.t
3) In a koha-shell, run:
   perl -MKoha::Reports::Analyzer=analyze -MData::Dumper -e \
     'print Dumper analyze({ sql => "UPDATE borrowers SET surname=1" })'
4) Note the forbidden_statement finding with severity high!
5) Repeat with "SELECT password FROM borrowers", note forbidden_column!
6) Repeat with "SELECT borrowernumber FROM borrowers LIMIT 1", note the
   empty findings list!

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to