I don't understand how the above solution would work with issue reported.
The code within /course/enrol.php is redirecting to /enrol/index.php
redirect(new moodle_url('/enrol/index.php', array('id'=>$id)));
So, users are still presented with the form upon clicking the link?
I wonder, if it is meant to behave that way. But, it is definitely misleading to end-users.