mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 03:16:42 +02:00
MDL-80072 core: Mark nocache option to format_text as deprecated
This was actually deprecated back in MDL-34347 but never actually emitted.
This commit is contained in:
parent
85c1dd0077
commit
3e6437e67c
3 changed files with 13 additions and 5 deletions
|
@ -111,9 +111,9 @@ class htmlpurifier_test extends \basic_testcase {
|
||||||
*/
|
*/
|
||||||
public function test_format_text_allowid() {
|
public function test_format_text_allowid() {
|
||||||
// Start off by not allowing ids (default).
|
// Start off by not allowing ids (default).
|
||||||
$options = array(
|
$options = [
|
||||||
'nocache' => true
|
'allowid' => false,
|
||||||
);
|
];
|
||||||
$result = format_text('<div id="example">Frog</div>', FORMAT_HTML, $options);
|
$result = format_text('<div id="example">Frog</div>', FORMAT_HTML, $options);
|
||||||
$this->assertSame('<div>Frog</div>', $result);
|
$this->assertSame('<div>Frog</div>', $result);
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ information provided here is intended especially for developers.
|
||||||
* The fourth parameter to `format_text` now emits a deprecation notice.
|
* The fourth parameter to `format_text` now emits a deprecation notice.
|
||||||
It was originally deprecated in Moodle 2.0.
|
It was originally deprecated in Moodle 2.0.
|
||||||
* The smiley option for format_text has been removed. It was deprecated in Moodle 2.0.
|
* The smiley option for format_text has been removed. It was deprecated in Moodle 2.0.
|
||||||
|
* The nocache option for format_text has been removed. It was deprecated in Moodle 2.3.
|
||||||
|
|
||||||
=== 4.3 ===
|
=== 4.3 ===
|
||||||
|
|
||||||
|
|
|
@ -1240,7 +1240,6 @@ function format_text_menu() {
|
||||||
* Options:
|
* Options:
|
||||||
* trusted : If true the string won't be cleaned. Default false required noclean=true.
|
* trusted : If true the string won't be cleaned. Default false required noclean=true.
|
||||||
* noclean : If true the string won't be cleaned, unless $CFG->forceclean is set. Default false required trusted=true.
|
* noclean : If true the string won't be cleaned, unless $CFG->forceclean is set. Default false required trusted=true.
|
||||||
* nocache : If true the strign will not be cached and will be formatted every call. Default false.
|
|
||||||
* filter : If true the string will be run through applicable filters as well. Default true.
|
* filter : If true the string will be run through applicable filters as well. Default true.
|
||||||
* para : If true then the returned string will be wrapped in div tags. Default true.
|
* para : If true then the returned string will be wrapped in div tags. Default true.
|
||||||
* newlines : If true then lines newline breaks will be converted to HTML newline breaks. Default true.
|
* newlines : If true then lines newline breaks will be converted to HTML newline breaks. Default true.
|
||||||
|
@ -1327,6 +1326,15 @@ function format_text($text, $format = FORMAT_MOODLE, $options = null, $courseidd
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The nocache option was deprecated in Moodle 2.3 in MDL-34347.
|
||||||
|
if (array_key_exists('nocache', $options)) {
|
||||||
|
unset($options['nocache']);
|
||||||
|
debugging(
|
||||||
|
'The nocache option is deprecated and no longer used.',
|
||||||
|
DEBUG_DEVELOPER,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$validoptions = [
|
$validoptions = [
|
||||||
'text',
|
'text',
|
||||||
'format',
|
'format',
|
||||||
|
@ -1340,7 +1348,6 @@ function format_text($text, $format = FORMAT_MOODLE, $options = null, $courseidd
|
||||||
'blanktarget',
|
'blanktarget',
|
||||||
'allowid',
|
'allowid',
|
||||||
'noclean',
|
'noclean',
|
||||||
'nocache',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$invalidoptions = array_diff(array_keys($options), $validoptions);
|
$invalidoptions = array_diff(array_keys($options), $validoptions);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue