Skip to content

Commit bff3430

Browse files
committed
Lib: Fix bad xml from QuickBase being parsed
QuickBase loves to send bad XML packets in their api... This checks for and removes an instance of that with DoQuery when no records are returned.
1 parent ed5ce7c commit bff3430

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

quickbase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ final protected static function cleanXml2Arr(&$arr){
357357
}else
358358
if(strtolower($arr[$key]) === 'false'){
359359
$arr[$key] = false;
360+
}else{
361+
$arr[$key] = trim($arr[$key]);
360362
}
361363
}
362364
}
@@ -552,6 +554,10 @@ final public static function API_Authenticate(&$query, &$results){
552554
final public static function API_DoQuery(&$query, &$results){
553555
if(isset($query->options['fmt']) && $query->options['fmt'] === 'structured'){
554556
if(isset($results['table']['records'])){
557+
if(!is_array($results['table']['records']) && $results['table']['records'] === ''){
558+
$results['table']['records'] = array();
559+
}
560+
555561
for($i = 0, $l = count($results['table']['records']); $i < $l; ++$i){
556562
$newRecord = array(
557563
'update_id' => $results['table']['records'][$i]['update_id']

0 commit comments

Comments
 (0)