diff options
author | Mario <mario@mariovavti.com> | 2018-10-08 11:18:28 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2018-10-08 11:18:28 +0200 |
commit | 13c08f96605ff6659f763d749a40447b497681a0 (patch) | |
tree | 2e3892ebc8b12f640be8c38640978f0a8306cc8e | |
parent | a00aae702d1fd933d517243d7e555ed4428b9cba (diff) | |
parent | d9efb037e3d0c14fa288e8b54c3d55d67689ab54 (diff) | |
download | volse-hubzilla-13c08f96605ff6659f763d749a40447b497681a0.tar.gz volse-hubzilla-13c08f96605ff6659f763d749a40447b497681a0.tar.bz2 volse-hubzilla-13c08f96605ff6659f763d749a40447b497681a0.zip |
Merge branch 'patch-2' into 'dev'
Prevent links damage on foreign channel repost for cloned
See merge request hubzilla/core!1307
-rw-r--r-- | include/text.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php index f03d0b860..1d884593f 100644 --- a/include/text.php +++ b/include/text.php @@ -2965,7 +2965,9 @@ function item_url_replace($channel,&$item,$old,$new,$oldnick = '') { json_url_replace('/' . $oldnick . '/' ,'/' . $channel['channel_address'] . '/' ,$item['target']); } - if(string_replace($old,$new,$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; } |