ispringsolutions / moodle-mod_ispring

Other
0 stars 0 forks source link

include files should use defined('MOODLE_INTERNAL') || die(); #9

Closed purnendudash closed 6 months ago

purnendudash commented 7 months ago

If a php file should not be loaded on it's own (class files etc) then you should be adding a check to: defined('MOODLE_INTERNAL') || die();

at the top of the file.

https://github.com/ispringsolutions/moodle-mod_ispring/blob/c4b32f7207a1b39c924c33ab29ed07671ed7a4bd/lib.php#L32

Andreanapolicy commented 6 months ago

Hi, @purnendudash.

I fixed the issue in lib.php, ran the check moodle-local_codechecker 2024041000 and saw the warning Unexpected MOODLE_INTERNAL check. No side effects or multiple artifacts detected for the lib.php file. Why should we use MOODLE_INTERNAL check in lib.php? Are there any other files where we should use MOODLE_INTERNAL check, but moodle-local_codechecker didn't highlight them for us?

Andreanapolicy commented 6 months ago

Fixed in #12