ngandrass / moodle-quiz_archiver

Archives quiz attempts as PDF and HTML files for long-term storage independent of Moodle
GNU General Public License v3.0
5 stars 3 forks source link

please don't call curl_init() directly #1

Closed danmarsden closed 8 months ago

danmarsden commented 8 months ago

Please don't initate curl_init() directly but use Moodle's own "curl" class which is a wrapper on PHP's curl functions.

The wrapper takes care of a number of things like security/proxy settings that sites may have implemented and the Moodle curl wrapper does this for you - unfortunately it's not docuemented all that well, but do a search on the core code base for curl to see examples of it's use.

not a blocker for plugins db approval - but quite important :-)

ngandrass commented 8 months ago

Thanks for your suggestion. I was totally unaware that this wrapper exists. I removed all uses of the plain PHP curl wrapper and replaced them with \curl from lib/filelib.php with ab8a6e2092b85188951e2a96f49185abdf103726 :tada: