File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -386,12 +386,18 @@ final protected static function xml2Arr($xml, &$arr){
386
386
$ arr [$ key ] = array ();
387
387
}
388
388
389
+ $ node = trim (strval ($ xml ->current ()));
390
+
389
391
if ($ xml ->hasChildren ()){
390
- $ node = array ();
392
+ if ($ node !== '' ){
393
+ $ node = array (
394
+ '_ ' => $ node
395
+ );
396
+ }else {
397
+ $ node = array ();
398
+ }
391
399
392
400
self ::xml2Arr ($ xml ->current (), $ node );
393
- }else {
394
- $ node = strval ($ xml ->current ());
395
401
}
396
402
397
403
$ attrs = $ xml ->current ()->attributes ();
@@ -572,7 +578,16 @@ final public static function API_DoQuery(&$query, &$results){
572
578
}
573
579
574
580
foreach ($ results ['table ' ]['records ' ][$ i ]['f ' ] as $ key => $ field ){
575
- $ newRecord [$ field ['id ' ]] = $ field ['_ ' ];
581
+ if (isset ($ field ['url ' ])){
582
+ $ value = array (
583
+ 'filename ' => $ field ['_ ' ],
584
+ 'url ' => $ field ['url ' ]
585
+ );
586
+ }else {
587
+ $ value = $ field ['_ ' ];
588
+ }
589
+
590
+ $ newRecord [$ field ['id ' ]] = $ value ;
576
591
}
577
592
578
593
$ results ['table ' ]['records ' ][$ i ] = $ newRecord ;
You can’t perform that action at this time.
0 commit comments