MDL-51375 excel output: more work to avoid invalid sheet names

This commit is contained in:
Tim Hunt 2015-09-17 21:40:06 +01:00
parent 35d3e8b00b
commit 55656b0c7d

View File

@ -160,7 +160,7 @@ class MoodleExcelWorksheet {
*/
public function __construct($name, PHPExcel $workbook) {
// Replace any characters in the name that Excel cannot cope with.
$name = strtr($name, '[]*/\?:', ' ');
$name = strtr(trim($name, "'"), '[]*/\?:', ' ');
// Shorten the title if necessary.
$name = core_text::substr($name, 0, 31);