Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'MDL-36845_22' of git://github.com/timhunt/moodle into M…

…OODLE_22_STABLE
  • Loading branch information...
commit 3b36eaac603bc030a58cd5de6d1b3f229b7130d6 2 parents e89bf76 + f196602
Dan Poltawski authored December 11, 2012
7  lib/excellib.class.php
@@ -74,8 +74,8 @@ function MoodleExcelWorkbook($filename) {
74 74
      * @param string $name Name of the sheet
75 75
      * @return object MoodleExcelWorksheet
76 76
      */
77  
-    function &add_worksheet($name = '') {
78  
-    /// Create the Moodle Worksheet. Returns one pointer to it
  77
+    function add_worksheet($name = '') {
  78
+        // Create the Moodle Worksheet. Returns one pointer to it
79 79
         $ws = new MoodleExcelWorksheet ($name, $this->pear_excel_workbook, $this->latin_output);
80 80
         return $ws;
81 81
     }
@@ -138,6 +138,9 @@ class MoodleExcelWorksheet {
138 138
      */
139 139
     function MoodleExcelWorksheet($name, &$workbook, $latin_output=false) {
140 140
 
  141
+        // Replace any characters in the name that Excel cannot cope with.
  142
+        $name = strtr($name, '[]*/\?:', '       ');
  143
+
141 144
         if (strlen($name) > 31) {
142 145
             // Excel does not seem able to cope with sheet names > 31 chars.
143 146
             // With $latin_output = false, it does not cope at all.
2  lib/tablelib.php
@@ -1505,7 +1505,7 @@ function start_document($filename) {
1505 1505
     }
1506 1506
 
1507 1507
     function start_table($sheettitle) {
1508  
-        $this->worksheet =& $this->workbook->add_worksheet($sheettitle);
  1508
+        $this->worksheet = $this->workbook->add_worksheet($sheettitle);
1509 1509
         $this->rownum=0;
1510 1510
     }
1511 1511
 

0 notes on commit 3b36eaa

Please sign in to comment.
Something went wrong with that request. Please try again.