From 754611738865eacba7f4acc235c03bad85dfa2c3 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 25 Aug 2013 20:11:49 -0700 Subject: Try to ensure full paths don't leak into xchan_addr and hubloc_addr --- boot.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index f28021b60..a4fe8d3ad 100755 --- a/boot.php +++ b/boot.php @@ -1316,6 +1316,11 @@ function fix_system_urls($oldurl,$newurl) { if(! $parsed) continue; $newhost = $parsed['host']; + // sometimes parse_url returns unexpected results. + + if(strpos($newhost,'/') !== false) + $newhost = substr($newhost,0,strpos($newhost,'/')); + $rhs = $newhost . (($parsed['port']) ? ':' . $parsed['port'] : '') . (($parsed['path']) ? $parsed['path'] : ''); $x = q("update xchan set xchan_addr = '%s', xchan_url = '%s', xchan_connurl = '%s', xchan_follow = '%s', xchan_connpage = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s' where xchan_hash = '%s' limit 1", -- cgit v1.2.3