From 233e4e13636edd857ded7393555feb4bf198eed3 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 14 Jul 2014 01:38:16 -0700 Subject: remove some code duplication --- include/items.php | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 7f4dabaa7..26d2fbe1c 100755 --- a/include/items.php +++ b/include/items.php @@ -189,15 +189,8 @@ function add_source_route($iid,$hash) { function red_zrl_callback($matches) { - $m = @parse_url($matches[2]); - $zrl = false; - if($m['host']) { - $r = q("select hubloc_url from hubloc where hubloc_host = '%s' limit 1", - dbesc($m['host']) - ); - if($r) - $zrl = true; - } + require_once('include/hubloc.php'); + $zrl = is_matrix_url($matches[2]); $t = strip_zids($matches[2]); if($t !== $matches[2]) { @@ -236,15 +229,8 @@ function red_unescape_codeblock($m) { function red_zrlify_img_callback($matches) { - $m = @parse_url($matches[2]); - $zrl = false; - if($m['host']) { - $r = q("select hubloc_url from hubloc where hubloc_host = '%s' limit 1", - dbesc($m['host']) - ); - if($r) - $zrl = true; - } + require_once('include/hubloc.php'); + $zrl = is_matrix_url($matches[2]); $t = strip_zids($matches[2]); if($t !== $matches[2]) { -- cgit v1.2.3