mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 21:45:37 +02:00
MDL-52983 excel output: avoid single quote on end of sheet name
This change resolves a problem where a long sheet name, which gets trimmed down with substr($name, 0, 31), could result in a sheet name with a single quote on the end because the quote removal was done before the substr.
This commit is contained in:
parent
9d5d9c64ff
commit
15c9a9d726
@ -163,6 +163,8 @@ class MoodleExcelWorksheet {
|
||||
$name = strtr(trim($name, "'"), '[]*/\?:', ' ');
|
||||
// Shorten the title if necessary.
|
||||
$name = core_text::substr($name, 0, 31);
|
||||
// After the substr, we might now have a single quote on the end.
|
||||
$name = trim($name, "'");
|
||||
|
||||
if ($name === '') {
|
||||
// Name is required!
|
||||
|
Loading…
x
Reference in New Issue
Block a user