From 55656b0c7d87e079a105604fe79fe5e382723f2f Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 17 Sep 2015 21:40:06 +0100 Subject: [PATCH] MDL-51375 excel output: more work to avoid invalid sheet names --- lib/excellib.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/excellib.class.php b/lib/excellib.class.php index b2731b2626b..b75f173a06e 100644 --- a/lib/excellib.class.php +++ b/lib/excellib.class.php @@ -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);