MDL-48980 Security: Always clean the result from min_get_slash_argument
authorDamyon Wiese <damyon@moodle.com>
Tue, 27 Jan 2015 15:16:10 +0000 (23:16 +0800)
committerDavid Monllao <davidm@moodle.com>
Wed, 28 Jan 2015 06:38:29 +0000 (14:38 +0800)
commitaf9a7937cc085f96bdbc4724cadec6eeae0242fc
tree480fff5ce70f9635490b65440a9adafd0c69872d
parente5d0b0492e45d34e4fd94b9bb97368b706e46895
MDL-48980 Security: Always clean the result from min_get_slash_argument

The result from this function is used in send_file calls and if unclean
(windows dir separators, or .. path components) it could expose sensitive
files (e.g. .php files). Now we always clean the result from this function
even if it means double cleaning.

I also fixed the unit test for this function and added a new test for this cleaning.

I also updated the comments to point to get_file_argument as the full version of
min_get_slash_argument.
lib/configonlylib.php
lib/tests/configonlylib_test.php