generalise the output format of xchan_fetch so it matches the input format
This commit is contained in:
parent
241bb3b940
commit
f524fb1f20
@ -247,5 +247,15 @@ function xchan_fetch($arr) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
$r = q("select * from xchan where $key = '$v'");
|
$r = q("select * from xchan where $key = '$v'");
|
||||||
return $r;
|
if(! $r)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$ret = array();
|
||||||
|
foreach($r as $k => $v) {
|
||||||
|
if($k === 'xchan_addr')
|
||||||
|
$ret['address'] = $v;
|
||||||
|
else
|
||||||
|
$ret[str_replace('xchan_','',$k)] = $v;
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
}
|
}
|
Reference in New Issue
Block a user