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
753753 $ stringNumber ++; // Base 1
754754
755755 $ 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 " );
757757 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 ;
761764 }
762- return $ t -> nodeValue ;
765+ return $ text ;
763766 }
764767 return null ;
765768 }
Original file line number Diff line number Diff line change 3333 assert ($ xlsxFastEditor ->readFloat ($ sheet1 , 'e5 ' ) === null );
3434 assert ($ xlsxFastEditor ->readInt ($ sheet1 , 'c3 ' ) === -5 );
3535 assert ($ xlsxFastEditor ->readInt ($ sheet1 , 'F6 ' ) === null );
36+ assert ($ xlsxFastEditor ->readString ($ sheet1 , 'B3 ' ) === 'déjà-vu ' );
3637 assert ($ xlsxFastEditor ->readString ($ sheet1 , 'b4 ' ) === 'naïveté ' );
3738 assert ($ xlsxFastEditor ->readString ($ sheet1 , 'F7 ' ) === null );
3839 assert ($ xlsxFastEditor ->readHyperlink ($ sheet1 , 'B4 ' ) === 'https://example.net/ ' );
You can’t perform that action at this time.
0 commit comments