Skip to content

Commit 328e837

Browse files
authored
Merge branch '18.2.x' into sstoychev/flickering-test-combo
2 parents 3386dc5 + ce1b4b6 commit 328e837

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master, 18.1.x, 17.2.x, 16.1.x, 15.1.x ]
16+
branches: [ master, 18.2.x, 17.2.x, 16.1.x, 15.1.x ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master, 18.1.x, 17.2.x, 16.1.x, 15.1.x ]
19+
branches: [ master, 18.2.x, 17.2.x, 16.1.x, 15.1.x ]
2020
schedule:
2121
- cron: '33 4 * * 4'
2222

projects/igniteui-angular/src/lib/services/excel/excel-exporter.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,21 @@ describe('Excel Exporter', () => {
134134
await wrapper.verifyDataFilesContent(actualData.contactsDataSkippedColumnContent);
135135
});
136136

137+
it('should not fail when data contains null characters (#14944).', async () => {
138+
options.columnWidth = 50;
139+
const wrapper = await getExportedData([
140+
'Terrance\u0000Orta',
141+
'Richard Mahoney\x00LongerName',
142+
'Donna\0Price',
143+
'Lisa Landers',
144+
'Dorothy H. Spencer'
145+
], options);
146+
147+
wrapper.verifyStructure();
148+
await wrapper.verifyTemplateFilesContent();
149+
await wrapper.verifyDataFilesContent(actualData.noHeadersStringDataWithNullChars);
150+
});
151+
137152
const getExportedData = (data: any[], exportOptions: IgxExcelExporterOptions) => {
138153
const result = new Promise<ZipWrapper>((resolve) => {
139154
exporter.exportEnded.pipe(first()).subscribe((value) => {

projects/igniteui-angular/src/lib/services/excel/test-data.service.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,4 +1935,22 @@ export class FileContentData {
19351935

19361936
return this.createData();
19371937
}
1938+
1939+
public get noHeadersStringDataWithNullChars() {
1940+
this._sharedStringsData = `count="6" uniqueCount="6"><si><t>Column1</t></si><si><t>TerranceOrta</t></si>` +
1941+
`<si><t>Richard MahoneyLongerName</t></si><si><t>DonnaPrice</t></si><si><t>Lisa Landers</t></si><si><t>` +
1942+
`Dorothy H. Spencer</t></si>`;
1943+
1944+
this._tableData = `ref="A1:A6" totalsRowShown="0"><autoFilter ref="A1:A6"/><tableColumns count="1">` +
1945+
`<tableColumn id="1" name="Column1"/></tableColumns>`;
1946+
1947+
this._worksheetData = `<dimension ref="A1:A6"/><sheetViews><sheetView tabSelected="1" workbookViewId="0"></sheetView>` +
1948+
`</sheetViews><sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/><cols><col min="1" max="1" ` +
1949+
`width="50" customWidth="1"/></cols><sheetData><row r="1"><c r="A1" t="s"><v>0</v></c></row><row r="2">` +
1950+
`<c r="A2" t="s"><v>1</v></c></row><row r="3"><c r="A3" t="s"><v>2</v></c></row><row r="4"><c r="A4" t="s"><v>3</v>` +
1951+
`</c></row><row r="5"><c r="A5" t="s"><v>4</v></c></row><row r="6"><c r="A6" t="s"><v>5</v></c></row></sheetData>`;
1952+
1953+
return this.createData();
1954+
}
1955+
19381956
}

projects/igniteui-angular/src/lib/services/exporter-common/export-utilities.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ export class ExportUtilities {
6868
.replace(/</g, '&lt;')
6969
.replace(/>/g, '&gt;')
7070
.replace(/"/g, '&quot;')
71-
.replace(/'/g, '&apos;');
71+
.replace(/'/g, '&apos;')
72+
// Bug #14944 - Remove the not supported null character (\u0000, \x00)
73+
.replace(/\x00/g, '');
7274
}
7375
}
7476
}

0 commit comments

Comments
 (0)