aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-07-14 01:38:16 -0700
committerfriendica <info@friendica.com>2014-07-14 01:38:16 -0700
commit233e4e13636edd857ded7393555feb4bf198eed3 (patch)
tree27c06018d534ff5e411a8aff4831a513d92801a5 /include/items.php
parent17bd39fcd4b28e6475a8a349f136c788202eaff4 (diff)
downloadvolse-hubzilla-233e4e13636edd857ded7393555feb4bf198eed3.tar.gz
volse-hubzilla-233e4e13636edd857ded7393555feb4bf198eed3.tar.bz2
volse-hubzilla-233e4e13636edd857ded7393555feb4bf198eed3.zip
remove some code duplication
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php22
1 files changed, 4 insertions, 18 deletions
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]) {