From 59d42e1ed23f916dcb47d53c745bef18a116d800 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 23 Mar 2023 10:17:48 +0800 Subject: [PATCH] MDL-77718 editor_tiny: Restrict the revision to int for loaders The revision should always be an int. I suspect this was missed during debugging and not corrected. --- lib/editor/tiny/lang.php | 4 ++-- lib/editor/tiny/loader.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/editor/tiny/lang.php b/lib/editor/tiny/lang.php index d3a5e988af9..4bd368ce56f 100644 --- a/lib/editor/tiny/lang.php +++ b/lib/editor/tiny/lang.php @@ -74,10 +74,10 @@ class lang { } [$rev, $lang] = explode('/', $slashargument, 2); - $rev = min_clean_param($rev, 'RAW'); + $rev = min_clean_param($rev, 'INT'); $lang = min_clean_param($lang, 'SAFEDIR'); } else { - $rev = min_optional_param('rev', 0, 'RAW'); + $rev = min_optional_param('rev', 0, 'INT'); $lang = min_optional_param('lang', 'standard', 'SAFEDIR'); } diff --git a/lib/editor/tiny/loader.php b/lib/editor/tiny/loader.php index 5bcf26a5294..5f26c305142 100644 --- a/lib/editor/tiny/loader.php +++ b/lib/editor/tiny/loader.php @@ -74,10 +74,10 @@ class loader { } [$rev, $filepath] = explode('/', $slashargument, 2); - $this->rev = min_clean_param($rev, 'RAW'); + $this->rev = min_clean_param($rev, 'INT'); $this->filepath = min_clean_param($filepath, 'SAFEPATH'); } else { - $this->rev = min_optional_param('rev', 0, 'RAW'); + $this->rev = min_optional_param('rev', 0, 'INT'); $this->filepath = min_optional_param('filepath', 'standard', 'SAFEPATH'); } -- 2.11.4.GIT