simplerisk/code

add_framework_control_test function fails on $approximate_time being empty string

milovanderlinden opened this issue · 3 comments

When in the Compliance menu, you try to add a test to a Control and do not enter an approximate time, a SQL error is thrown and shown to the user. I have a fix available for this which I will send in as a pull request.

Mmm,

cannot do a pull request, to many changes that are unrelated pending. But this is the fix:

On line 65 and 88 of simplerisk/compliance/index.php and on line 150 of simplerisk/compliance/audit_initiation.php put

$approximate_time = is_int($_POST['approximate_time']) ? $_POST['approximate_time'] : 0;

And the issue is solved.

Thank you, Milo! I added this to our dev code and it will roll live with our next release.

This has rolled live in the 20180916-001 release.