aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-04-03 10:51:34 +0200
committerMario <mario@mariovavti.com>2020-04-03 10:51:34 +0200
commit31fea1014ef634fe1457451332b8e478768c5645 (patch)
tree47c05dd658a889725c4455ac4f2f19bb4e1da7e9 /boot.php
parent898fea1e0e5b2bb3d0689a09e6f287a212108ab5 (diff)
parenta3acec96745f90443de84d8503334b3a204436fb (diff)
downloadvolse-hubzilla-31fea1014ef634fe1457451332b8e478768c5645.tar.gz
volse-hubzilla-31fea1014ef634fe1457451332b8e478768c5645.tar.bz2
volse-hubzilla-31fea1014ef634fe1457451332b8e478768c5645.zip
Merge branch 'dev' into 'dev'
fix app links in DB when doing a site rename See merge request hubzilla/core!1846
Diffstat (limited to 'boot.php')
-rwxr-xr-xboot.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index 4a7b86f3e..4d641baf0 100755
--- a/boot.php
+++ b/boot.php
@@ -1593,6 +1593,22 @@ function fix_system_urls($oldurl, $newurl) {
}
}
+ // fix links in apps
+
+ $a = q("select id, app_url, app_photo from app where app_url like '%s' OR app_photo like '%s'",
+ dbesc('%' . $oldurl . '%'),
+ dbesc('%' . $oldurl . '%')
+ );
+ if($a) {
+ foreach($a as $aa) {
+ q("update app set app_url = '%s', app_photo = '%s' where id = %d",
+ dbesc(str_replace($oldurl,$newurl,$aa['app_url'])),
+ dbesc(str_replace($oldurl,$newurl,$aa['app_photo'])),
+ intval($aa['id'])
+ );
+ }
+ }
+
// now replace any remote xchans whose photos are stored locally (which will be most if not all remote xchans)
$r = q("select * from xchan where xchan_photo_l like '%s'",