Merge branch 'MDL-51375' of git://github.com/timhunt/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 12 Oct 2015 16:01:41 +0000 (17:01 +0100)
committerDan Poltawski <dan@moodle.com>
Mon, 12 Oct 2015 16:01:41 +0000 (17:01 +0100)
lib/excellib.class.php

index b2731b2..b75f173 100644 (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);