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){
386386 $ arr [$ key ] = array ();
387387 }
388388
389+ $ node = trim (strval ($ xml ->current ()));
390+
389391 if ($ xml ->hasChildren ()){
390- $ node = array ();
392+ if ($ node !== '' ){
393+ $ node = array (
394+ '_ ' => $ node
395+ );
396+ }else {
397+ $ node = array ();
398+ }
391399
392400 self ::xml2Arr ($ xml ->current (), $ node );
393- }else {
394- $ node = strval ($ xml ->current ());
395401 }
396402
397403 $ attrs = $ xml ->current ()->attributes ();
@@ -572,7 +578,16 @@ final public static function API_DoQuery(&$query, &$results){
572578 }
573579
574580 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 ;
576591 }
577592
578593 $ results ['table ' ]['records ' ][$ i ] = $ newRecord ;
You can’t perform that action at this time.
0 commit comments