Merge branch 'cherry-pick-03317b98' into 'dev'

fix query with protocol prefix not always picking the right xchan

See merge request hubzilla/core!1765
This commit is contained in:
M. Dent 2019-11-04 19:58:01 +01:00
commit 09284d512d

View File

@ -142,7 +142,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
$sql_options = (($protocol) ? " and xchan_network = '" . dbesc($protocol) . "' " : '');
$r = q("select * from xchan where xchan_hash = '%s' or xchan_url = '%s' $sql_options ",
$r = q("select * from xchan where (xchan_addr = '%s' or xchan_url = '%s') $sql_options ",
dbesc($url),
dbesc($url)
);