Skip to content

Commit

Permalink
MDL-77718 editor_tiny: Restrict the revision to int for loaders
Browse files Browse the repository at this point in the history
The revision should always be an int. I suspect this was missed during
debugging and not corrected.
  • Loading branch information
andrewnicols authored and Jenkins committed Apr 19, 2023
1 parent 4d46352 commit 1d16c04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/editor/tiny/lang.php
Expand Up @@ -74,10 +74,10 @@ protected function parse_file_information_from_url(): void {
}

[$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');
}

Expand Down
4 changes: 2 additions & 2 deletions lib/editor/tiny/loader.php
Expand Up @@ -74,10 +74,10 @@ protected function parse_file_information_from_url(): void {
}

[$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');
}

Expand Down

0 comments on commit 1d16c04

Please sign in to comment.