aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-04-25 11:54:13 +0200
committerMario Vavti <mario@mariovavti.com>2018-04-25 11:54:13 +0200
commite9f3095f419310139bf279e265f7f61f7824c51d (patch)
tree72ee47baa7d9c2f2e2c9f6650246b6a20e0a879e
parentddb9db188b2c3e85eec6c539adcb250e653b5353 (diff)
parent63e8f1f36b1b33f825b2c544b610e140291d0048 (diff)
downloadvolse-hubzilla-e9f3095f419310139bf279e265f7f61f7824c51d.tar.gz
volse-hubzilla-e9f3095f419310139bf279e265f7f61f7824c51d.tar.bz2
volse-hubzilla-e9f3095f419310139bf279e265f7f61f7824c51d.zip
Merge remote-tracking branch 'mike/master' into dev
-rw-r--r--include/text.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/text.php b/include/text.php
index 4d6d0ffb5..60f6ff383 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2033,13 +2033,16 @@ function item_post_type($item) {
function undo_post_tagging($s) {
$matches = null;
+ $x = null;
// undo tags and mentions
$cnt = preg_match_all('/([@#])(\!*)\[zrl=(.*?)\](.*?)\[\/zrl\]/ism',$s,$matches,PREG_SET_ORDER);
if($cnt) {
foreach($matches as $mtch) {
- $x = q("select xchan_addr, xchan_url from xchan where xchan_url = '%s' limit 1",
- dbesc($mtch[3])
- );
+ if($mtch[1] === '@') {
+ $x = q("select xchan_addr, xchan_url from xchan where xchan_url = '%s' limit 1",
+ dbesc($mtch[3])
+ );
+ }
if($x) {
$s = str_replace($mtch[0], $mtch[1] . $mtch[2] . '{' . (($x[0]['xchan_addr']) ? $x[0]['xchan_addr'] : $x[0]['xchan_url']) . '}', $s);
}