aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-05-08 10:43:06 +0200
committerMax Kostikov <max@kostikov.co>2019-05-08 10:43:06 +0200
commitea19d59fca366c5f997ba5b5136e1237f0b50ef8 (patch)
treecc17297bcea33248ffdf578f8b8997e3875b6d6e /include
parent7b17306dbd6f7d41d47aa13be208b7283409db7a (diff)
parentd34d14c1f463404b28898d398a4d37436fa3c856 (diff)
downloadvolse-hubzilla-ea19d59fca366c5f997ba5b5136e1237f0b50ef8.tar.gz
volse-hubzilla-ea19d59fca366c5f997ba5b5136e1237f0b50ef8.tar.bz2
volse-hubzilla-ea19d59fca366c5f997ba5b5136e1237f0b50ef8.zip
Merge branch 'dev' into 'dev'
Replace own image URL in clonned channel posts See merge request hubzilla/core!1638
Diffstat (limited to 'include')
-rw-r--r--include/text.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/text.php b/include/text.php
index 276264162..3e2b72087 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3081,13 +3081,12 @@ function item_url_replace($channel,&$item,$old,$new,$oldnick = '') {
if($oldnick)
json_url_replace('/' . $oldnick . '/' ,'/' . $channel['channel_address'] . '/' ,$item['target']);
}
+
+ $item['body'] = preg_replace("/(\[zrl=".preg_quote($old,'/')."\/photos\/".$channel['channel_address'].".+\]\[zmg=\d+x\d+\])".preg_quote($old,'/')."\/(.+\[\/zmg\])/", '${1}'.$new.'/${2}', $item['body']);
+ $item['body'] = preg_replace("/".preg_quote($old,'/')."\/(search|\w+\/".$channel['channel_address'].")/", $new.'/${1}', $item['body']);
- $x = preg_replace("/".preg_quote($old,'/')."\/(search|\w+\/".$channel['channel_address'].")/", $new.'/${1}', $item['body']);
- if($x) {
- $item['body'] = $x;
- $item['sig'] = base64url_encode(rsa_sign($item['body'],$channel['channel_prvkey']));
- $item['item_verified'] = 1;
- }
+ $item['sig'] = base64url_encode(rsa_sign($item['body'],$channel['channel_prvkey']));
+ $item['item_verified'] = 1;
$item['plink'] = str_replace($old,$new,$item['plink']);
if($oldnick)