mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-33007 add workaround for broken iconv //IGNORE
This patch adds mbstring utf-8 cleanup fallback and admin warning if no utf-8 cleanup possible in user submitted data.
This commit is contained in:
parent
3681e78429
commit
0aff15c2c9
6 changed files with 48 additions and 15 deletions
|
@ -242,13 +242,14 @@ class core_admin_renderer extends plugin_renderer_base {
|
|||
* @param bool $cronoverdue warn cron not running
|
||||
* @param bool $dbproblems warn db has problems
|
||||
* @param bool $maintenancemode warn in maintenance mode
|
||||
* @param bool $buggyiconvnomb warn iconv problems
|
||||
* @param array|null $availableupdates array of available_update_info objects or null
|
||||
* @param int|null $availableupdatesfetch timestamp of the most recent updates fetch or null (unknown)
|
||||
*
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
|
||||
$cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch) {
|
||||
$cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb) {
|
||||
global $CFG;
|
||||
$output = '';
|
||||
|
||||
|
@ -257,6 +258,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
|||
$output .= empty($CFG->disableupdatenotifications) ? $this->available_updates($availableupdates, $availableupdatesfetch) : '';
|
||||
$output .= $this->insecure_dataroot_warning($insecuredataroot);
|
||||
$output .= $this->display_errors_warning($errorsdisplayed);
|
||||
$output .= $this->buggy_iconv_warning($buggyiconvnomb);
|
||||
$output .= $this->cron_overdue_warning($cronoverdue);
|
||||
$output .= $this->db_problems($dbproblems);
|
||||
$output .= $this->maintenance_mode_warning($maintenancemode);
|
||||
|
@ -381,6 +383,19 @@ class core_admin_renderer extends plugin_renderer_base {
|
|||
return $this->warning(get_string('displayerrorswarning', 'admin'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an appropriate message if iconv is buggy and mbstring missing.
|
||||
* @param bool $buggyiconvnomb
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
protected function buggy_iconv_warning($buggyiconvnomb) {
|
||||
if (!$buggyiconvnomb) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->warning(get_string('warningiconvbuggy', 'admin'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an appropriate message if cron has not been run recently.
|
||||
* @param bool $cronoverdue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue