diff options
author | zotlabs <mike@macgirvin.com> | 2016-11-13 20:22:01 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-11-13 20:22:01 -0800 |
commit | 3c302bae5ac71c1853d33117f9bbcfc0e5d81651 (patch) | |
tree | 008ba03057e4b22312724155d8c45b7559eb4ca5 /include/items.php | |
parent | 103cd2b7a15caaadd5ddf8a6b69c8e3de7a2982b (diff) | |
download | volse-hubzilla-3c302bae5ac71c1853d33117f9bbcfc0e5d81651.tar.gz volse-hubzilla-3c302bae5ac71c1853d33117f9bbcfc0e5d81651.tar.bz2 volse-hubzilla-3c302bae5ac71c1853d33117f9bbcfc0e5d81651.zip |
move all the zid related stuff to one file
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/include/items.php b/include/items.php index b1a83dfc2..4ac4d6049 100755 --- a/include/items.php +++ b/include/items.php @@ -291,78 +291,6 @@ function add_source_route($iid, $hash) { /** - * @brief preg_match function when fixing 'naked' links in mod item.php. - * - * Check if we've got a hubloc for the site and use a zrl if we do, a url if we don't. - * Remove any existing zid= param which may have been pasted by mistake - and will have - * the author's credentials. zid's are dynamic and can't really be passed around like - * that. - * - * @param array $matches - * @return string - */ -function red_zrl_callback($matches) { - require_once('include/hubloc.php'); - $zrl = is_matrix_url($matches[2]); - - $t = strip_zids($matches[2]); - if($t !== $matches[2]) { - $zrl = true; - $matches[2] = $t; - } - - if($matches[1] === '#^') - $matches[1] = ''; - if($zrl) - return $matches[1] . '#^[zrl=' . $matches[2] . ']' . $matches[2] . '[/zrl]'; - - return $matches[1] . '#^[url=' . $matches[2] . ']' . $matches[2] . '[/url]'; -} - -/** - * If we've got a url or zrl tag with a naked url somewhere in the link text, - * escape it with quotes unless the naked url is a linked photo. - * - * @param array $matches - * @return string - */ -function red_escape_zrl_callback($matches) { - - // Uncertain why the url/zrl forms weren't picked up by the non-greedy regex. - - if((strpos($matches[3], 'zmg') !== false) || (strpos($matches[3], 'img') !== false) || (strpos($matches[3],'zrl') !== false) || (strpos($matches[3],'url') !== false)) - return $matches[0]; - - return '[' . $matches[1] . 'rl' . $matches[2] . ']' . $matches[3] . '"' . $matches[4] . '"' . $matches[5] . '[/' . $matches[6] . 'rl]'; -} - -function red_escape_codeblock($m) { - return '[$b64' . $m[2] . base64_encode($m[1]) . '[/' . $m[2] . ']'; -} - -function red_unescape_codeblock($m) { - return '[' . $m[2] . base64_decode($m[1]) . '[/' . $m[2] . ']'; -} - - -function red_zrlify_img_callback($matches) { - require_once('include/hubloc.php'); - $zrl = is_matrix_url($matches[2]); - - $t = strip_zids($matches[2]); - if($t !== $matches[2]) { - $zrl = true; - $matches[2] = $t; - } - - if($zrl) - return '[zmg' . $matches[1] . ']' . $matches[2] . '[/zmg]'; - - return $matches[0]; -} - - -/** * @brief Post an activity. * * In its simplest form one needs only to set $arr['body'] to post a note to the logged in channel's wall. |