Permalink
Browse files

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

…OODLE_22_STABLE
  • Loading branch information...
2 parents e89bf76 + f196602 commit 3b36eaac603bc030a58cd5de6d1b3f229b7130d6 @danpoltawski danpoltawski committed Dec 11, 2012
Showing with 6 additions and 3 deletions.
  1. +5 −2 lib/excellib.class.php
  2. +1 −1 lib/tablelib.php
@@ -74,8 +74,8 @@ function MoodleExcelWorkbook($filename) {
* @param string $name Name of the sheet
* @return object MoodleExcelWorksheet
*/
- function &add_worksheet($name = '') {
- /// Create the Moodle Worksheet. Returns one pointer to it
+ function add_worksheet($name = '') {
+ // Create the Moodle Worksheet. Returns one pointer to it
$ws = new MoodleExcelWorksheet ($name, $this->pear_excel_workbook, $this->latin_output);
return $ws;
}
@@ -138,6 +138,9 @@ class MoodleExcelWorksheet {
*/
function MoodleExcelWorksheet($name, &$workbook, $latin_output=false) {
+ // Replace any characters in the name that Excel cannot cope with.
+ $name = strtr($name, '[]*/\?:', ' ');
+
if (strlen($name) > 31) {
// Excel does not seem able to cope with sheet names > 31 chars.
// With $latin_output = false, it does not cope at all.
View
@@ -1505,7 +1505,7 @@ function start_document($filename) {
}
function start_table($sheettitle) {
- $this->worksheet =& $this->workbook->add_worksheet($sheettitle);
+ $this->worksheet = $this->workbook->add_worksheet($sheettitle);
$this->rownum=0;
}

0 comments on commit 3b36eaa

Please sign in to comment.