diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/api.php | 10 | ||||
-rw-r--r-- | include/hubloc.php | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/include/api.php b/include/api.php index 8c0e32ecc..fdc8edece 100644 --- a/include/api.php +++ b/include/api.php @@ -727,6 +727,16 @@ require_once('include/items.php'); else $_REQUEST['parent_mid'] = $parent; + if($_REQUEST['namespace'] && $parent) { + $x = q("select iid from item_id where service = '%s' and sid = '%s' limit 1", + dbesc($_REQUEST['namespace']), + dbesc($parent) + ); + if($x) { + $_REQUEST['parent'] = $x[0]['iid']; + } + } + if(requestdata('lat') && requestdata('long')) $_REQUEST['coord'] = sprintf("%s %s",requestdata('lat'),requestdata('long')); diff --git a/include/hubloc.php b/include/hubloc.php index 98c1a21f3..ece7bd21a 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -256,12 +256,12 @@ function xchan_fetch($arr) { if(! $key) return false; - $r = q("select * from xchan where $key = '$v'"); + $r = q("select * from xchan where $key = '$v' limit 1"); if(! $r) return false; $ret = array(); - foreach($r as $k => $v) { + foreach($r[0] as $k => $v) { if($k === 'xchan_addr') $ret['address'] = $v; else |