aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-06 18:07:29 -0700
committerredmatrix <git@macgirvin.com>2016-04-06 18:07:29 -0700
commit29363a185dea07dbb035ccdc027a48881d8e96fd (patch)
treeba03fa88f7f990d368faa6fb639f4231bfee2ccf /include/text.php
parenta20ef706fd6e7011a0dc95df71222b9a5871e3b3 (diff)
downloadvolse-hubzilla-29363a185dea07dbb035ccdc027a48881d8e96fd.tar.gz
volse-hubzilla-29363a185dea07dbb035ccdc027a48881d8e96fd.tar.bz2
volse-hubzilla-29363a185dea07dbb035ccdc027a48881d8e96fd.zip
file sync work
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php25
1 files changed, 21 insertions, 4 deletions
diff --git a/include/text.php b/include/text.php
index a1a1cfb1c..d38f4f7c4 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2730,14 +2730,23 @@ function json_url_replace($old,$new,&$s) {
}
-function item_url_replace($channel,&$item,$old,$new) {
+function item_url_replace($channel,&$item,$old,$new,$oldnick = '') {
- if($item['attach'])
+ if($item['attach']) {
json_url_replace($old,$new,$item['attach']);
- if($item['object'])
+ if($oldnick)
+ json_url_replace('/' . $oldnick . '/' ,'/' . $channel['channel_address'] . '/' ,$item['attach']);
+ }
+ if($item['object']) {
json_url_replace($old,$new,$item['object']);
- if($item['target'])
+ if($oldnick)
+ json_url_replace('/' . $oldnick . '/' ,'/' . $channel['channel_address'] . '/' ,$item['object']);
+ }
+ if($item['target']) {
json_url_replace($old,$new,$item['target']);
+ if($oldnick)
+ json_url_replace('/' . $oldnick . '/' ,'/' . $channel['channel_address'] . '/' ,$item['target']);
+ }
if(string_replace($old,$new,$item['body'])) {
$item['sig'] = base64url_encode(rsa_sign($item['body'],$channel['channel_prvkey']));
@@ -2746,6 +2755,14 @@ function item_url_replace($channel,&$item,$old,$new) {
// @fixme item['plink'] and item['llink']
+ str_replace($old,$new,$item['plink']);
+ if($oldnick)
+ str_replace('/' . $oldnick . '/' ,'/' . $channel['channel_address'] . '/' ,$item['plink']);
+
+ str_replace($old,$new,$item['llink']);
+ if($oldnick)
+ str_replace('/' . $oldnick . '/' ,'/' . $channel['channel_address'] . '/' ,$item['llink']);
+
}