diff --git a/main/admin/settings.php b/main/admin/settings.php index 4070a85453..4649a665d3 100755 --- a/main/admin/settings.php +++ b/main/admin/settings.php @@ -413,7 +413,7 @@ foreach ($resultcategories as $row) { $url['content'] = Display::return_icon( $action_images[strtolower($row['category'])], api_ucfirst(get_lang($row['category'])), - '', + [], ICON_SIZE_MEDIUM ); if (strtolower($row['category']) == strtolower($_GET['category'])) { diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php index 98ed810d8f..cd1a18b62b 100755 --- a/main/inc/lib/display.lib.php +++ b/main/inc/lib/display.lib.php @@ -730,6 +730,12 @@ class Display $alternateCssPath = api_get_path(SYS_PUBLIC_PATH).'css/'; $alternateWebCssPath = api_get_path(WEB_PUBLIC_PATH).'css/'; + // Avoid issues with illegal string offset for legacy calls to this + // method with an empty string rather than null or an empty array + if (empty($additional_attributes)) { + $additional_attributes = []; + } + $image = trim($image); if (isset($size)) { diff --git a/main/user/user.php b/main/user/user.php index 76afe3dd45..b7f3b7f346 100755 --- a/main/user/user.php +++ b/main/user/user.php @@ -581,7 +581,7 @@ if (api_is_allowed_to_edit(null, true)) { $selectedTab = 1; $url = api_get_path(WEB_CODE_PATH).'user/subscribe_user.php?'.api_get_cidreq().'&type='.STUDENT; $icon = Display::url( - Display::return_icon('add-user.png', get_lang('Add'), '', ICON_SIZE_MEDIUM), + Display::return_icon('add-user.png', get_lang('Add'), [], ICON_SIZE_MEDIUM), $url ); break; @@ -589,7 +589,7 @@ if (api_is_allowed_to_edit(null, true)) { $selectedTab = 2; $url = api_get_path(WEB_CODE_PATH).'user/subscribe_user.php?'.api_get_cidreq().'&type='.COURSEMANAGER; $icon = Display::url( - Display::return_icon('add-teacher.png', get_lang('Add'), '', ICON_SIZE_MEDIUM), + Display::return_icon('add-teacher.png', get_lang('Add'), [], ICON_SIZE_MEDIUM), $url ); break; @@ -599,17 +599,17 @@ if (api_is_allowed_to_edit(null, true)) { echo '
'; echo $icon; $actions .= ''. - Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).' '; + Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), [], ICON_SIZE_MEDIUM).' '; $actions .= ''. - Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).' '; + Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), [], ICON_SIZE_MEDIUM).' '; if ($canEditUsers) { $actions .= ''. - Display::return_icon('import_csv.png', get_lang('ImportUsersToACourse'), '', ICON_SIZE_MEDIUM).' '; + Display::return_icon('import_csv.png', get_lang('ImportUsersToACourse'), [], ICON_SIZE_MEDIUM).' '; } $actions .= ''. - Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).' '; + Display::return_icon('pdf.png', get_lang('ExportToPDF'), [], ICON_SIZE_MEDIUM).' '; echo $actions; echo '
';