aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2020-03-11 15:18:33 -0700
committerzotlabs <mike@macgirvin.com>2020-03-11 15:18:33 -0700
commit938d26ba3e9c6566d00f7393daa3e1b36f2e5479 (patch)
tree583ff68d3494da87e7e8326e6920be760112ff96
parent16fd618380d2f88524b3545f751690b39be084f5 (diff)
downloadvolse-hubzilla-938d26ba3e9c6566d00f7393daa3e1b36f2e5479.tar.gz
volse-hubzilla-938d26ba3e9c6566d00f7393daa3e1b36f2e5479.tar.bz2
volse-hubzilla-938d26ba3e9c6566d00f7393daa3e1b36f2e5479.zip
fix app links in DB when doing a site rename
-rwxr-xr-xboot.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index 2e6d3c63c..db01a42a7 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'",