File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -753,13 +753,16 @@ public function _getSharedString(int $stringNumber): ?string
753
753
$ stringNumber ++; // Base 1
754
754
755
755
$ xpath = $ this ->getXPathFromPath (self ::SHARED_STRINGS_PATH );
756
- $ ts = $ xpath ->query ("/o:sst/o:si[ $ stringNumber][1]/ o:t[1] " );
756
+ $ ts = $ xpath ->query ("/o:sst/o:si[ $ stringNumber]// o:t " );
757
757
if ($ ts !== false && $ ts ->length > 0 ) {
758
- $ t = $ ts [0 ];
759
- if (!($ t instanceof \DOMElement)) {
760
- throw new XlsxFastEditorXmlException ("Error querying XML shared string {$ stringNumber }! " );
758
+ $ text = '' ;
759
+ foreach ($ ts as $ t ) {
760
+ if (!($ t instanceof \DOMElement)) {
761
+ throw new XlsxFastEditorXmlException ("Error querying XML shared string {$ stringNumber }! " );
762
+ }
763
+ $ text .= $ t ->nodeValue ;
761
764
}
762
- return $ t -> nodeValue ;
765
+ return $ text ;
763
766
}
764
767
return null ;
765
768
}
Original file line number Diff line number Diff line change 33
33
assert ($ xlsxFastEditor ->readFloat ($ sheet1 , 'e5 ' ) === null );
34
34
assert ($ xlsxFastEditor ->readInt ($ sheet1 , 'c3 ' ) === -5 );
35
35
assert ($ xlsxFastEditor ->readInt ($ sheet1 , 'F6 ' ) === null );
36
+ assert ($ xlsxFastEditor ->readString ($ sheet1 , 'B3 ' ) === 'déjà-vu ' );
36
37
assert ($ xlsxFastEditor ->readString ($ sheet1 , 'b4 ' ) === 'naïveté ' );
37
38
assert ($ xlsxFastEditor ->readString ($ sheet1 , 'F7 ' ) === null );
38
39
assert ($ xlsxFastEditor ->readHyperlink ($ sheet1 , 'B4 ' ) === 'https://example.net/ ' );
You can’t perform that action at this time.
0 commit comments