Fix sheet name escaping
Sheet names are stored as attributes of an XML entity. We therefore need a different escaping strategy, escaping quotes.
This commit is contained in:
1 parent
ee998f7173
commit
71cf0fe339
6 files changed
+12
-13
No files matched your search
@@ -17,7 +17,7 @@ class ODSTest extends TestCase
|
||||
{
|
||||
return [
|
||||
['test', 'test'],
|
||||
['carl\'s "pokemon"', 'carl\'s "pokemon"'],
|
||||
['carl\'s "pokemon"', 'carl's "pokemon"'],
|
||||
["\n", "\n"],
|
||||
["\r", "\r"],
|
||||
["\t", "\t"],
|
||||
|
||||
@@ -17,7 +17,7 @@ class XLSXTest extends TestCase
|
||||
{
|
||||
return [
|
||||
['test', 'test'],
|
||||
['adam\'s "car"', 'adam\'s "car"'],
|
||||
['adam\'s "car"', 'adam's "car"'],
|
||||
["\n", "\n"],
|
||||
["\r", "\r"],
|
||||
["\t", "\t"],
|
||||
@@ -26,7 +26,7 @@ class XLSXTest extends TestCase
|
||||
['_x0000_', '_x005F_x0000_'],
|
||||
[chr(21), '_x0015_'],
|
||||
['control ' . chr(21) . ' character', 'control _x0015_ character'],
|
||||
['control\'s ' . chr(21) . ' "character"', 'control\'s _x0015_ "character"'],
|
||||
['control\'s ' . chr(21) . ' "character"', 'control's _x0015_ "character"'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -441,7 +441,7 @@ class WriterTest extends TestCase
|
||||
|
||||
$this->writeToODSFile($dataRows, $fileName);
|
||||
|
||||
$this->assertValueWasWritten($fileName, 'I\'m in "great" mood', 'Quotes should not be escaped');
|
||||
$this->assertValueWasWritten($fileName, 'I'm in "great" mood', 'Quotes should not be escaped');
|
||||
$this->assertValueWasWritten($fileName, 'This <must> be escaped & tested', '<, > and & should be escaped');
|
||||
}
|
||||
|
||||
|
||||
@@ -498,7 +498,7 @@ class WriterTest extends TestCase
|
||||
|
||||
$this->writeToXLSXFile($dataRows, $fileName);
|
||||
|
||||
$this->assertInlineDataWasWrittenToSheet($fileName, 1, 'I\'m in "great" mood', 'Quotes should not be escaped');
|
||||
$this->assertInlineDataWasWrittenToSheet($fileName, 1, 'I'm in "great" mood', 'Quotes should not be escaped');
|
||||
$this->assertInlineDataWasWrittenToSheet($fileName, 1, 'This <must> be escaped & tested', '<, > and & should be escaped');
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user