MDL-61976 privacy: replace pluginfile in test writer

This commit is contained in:
Marina Glancy
2018-05-08 12:03:18 +08:00
parent 5a4cbdb34f
commit 7ceb3f8568
@@ -371,6 +371,8 @@ class content_writer implements \core_privacy\local\request\content_writer {
* actual writer exports files so it can be reliably tested only in real writers such as
* {@link core_privacy\local\request\moodle_content_writer}.
*
* However we have to remove @@PLUGINFILE@@ since otherwise {@link format_text()} shows debugging messages
*
* @param array $subcontext The location within the current context that this data belongs.
* @param string $component The name of the component that the files belong to.
* @param string $filearea The filearea within that component.
@@ -379,7 +381,7 @@ class content_writer implements \core_privacy\local\request\content_writer {
* @return string The processed string
*/
public function rewrite_pluginfile_urls(array $subcontext, $component, $filearea, $itemid, $text) {
return $text;
return str_replace('@@PLUGINFILE@@/', 'files/', $text);
}
/**