catalyst / moodle-local_smartmedia

Moodle LMS Smartmedia local plugin
Other
6 stars 5 forks source link

Ensure non-pluginfile URLS are ignored #214

Closed Peterburnett closed 2 years ago

Peterburnett commented 2 years ago

There was a type coercion issue that could occur with pluginfile.php not being present, after which false would immediately coerce to 0, which would then lead to errors when attempting to query files. This can happen in the cases where the string pluginfile.php is included in the input URL, while not actually being a valid targetable URL. Specifically tokenpluginfile.php was picked up by filter regex. Instead of complicating the regex the fix here is to simply safeguard this function to ensure the URL is a valid URL we can action.