From 6eb971656ef1710596084fdaa0ae3085df2c2101 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 20 Feb 2014 01:35:08 -0800 Subject: believe i found the issue which was causing hundreds/thousands of identical hublocs to be created --- include/zot.php | 21 ++++++++++++--------- mod/settings.php | 2 +- version.inc | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/zot.php b/include/zot.php index c9d426cc2..a7094b2ad 100644 --- a/include/zot.php +++ b/include/zot.php @@ -748,6 +748,16 @@ function import_xchan($arr,$ud_flags = 1) { } } + if(! $location['sitekey']) { + logger('import_xchan: empty hubloc sitekey. ' . print_r($location,true)); + continue; + } + + // Catch some malformed entries from the past which still exist + + if(strpos($location['address'],'/') !== false) + $location['address'] = substr($location['address'],0,strpos($location['address'],'/')); + // match as many fields as possible in case anything at all changed. $r = q("select * from hubloc where hubloc_hash = '%s' and hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_url = '%s' and hubloc_url_sig = '%s' and hubloc_host = '%s' and hubloc_addr = '%s' and hubloc_callback = '%s' and hubloc_sitekey = '%s' ", @@ -804,14 +814,6 @@ function import_xchan($arr,$ud_flags = 1) { continue; } - if(! $location['sitekey']) { - logger('import_xchan: empty hubloc sitekey. ' . print_r($location,true)); - continue; - } - - if(strpos($location['address'],'/') !== false) - $location['address'] = substr($location['address'],0,strpos($location['address'],'/')); - // new hub claiming to be primary. Make it so. if(intval($location['primary'])) { @@ -840,9 +842,11 @@ function import_xchan($arr,$ud_flags = 1) { ); $what .= 'newhub '; $changed = true; + } // get rid of any hubs we have for this channel which weren't reported. + if($xisting) { foreach($xisting as $x) { if(! array_key_exists('updated',$x)) { @@ -855,7 +859,6 @@ function import_xchan($arr,$ud_flags = 1) { } } } - } // Are we a directory server of some kind? diff --git a/mod/settings.php b/mod/settings.php index e9f4c9f8d..b88380ff0 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -261,7 +261,7 @@ function settings_post(&$a) { $maxreq = ((x($_POST,'maxreq')) ? intval($_POST['maxreq']) : 0); $expire = ((x($_POST,'expire')) ? intval($_POST['expire']) : 0); $def_group = ((x($_POST,'group-selection')) ? notags(trim($_POST['group-selection'])) : ''); - $channel_menu = ((x($_POST['channel_menu'])) ? htmlspecialchars_decode(trim($_POST['channel_menu'])) : ''); + $channel_menu = ((x($_POST['channel_menu'])) ? htmlspecialchars_decode(trim($_POST['channel_menu']),ENT_QUOTES) : ''); $expire_items = ((x($_POST,'expire_items')) ? intval($_POST['expire_items']) : 0); $expire_starred = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0); diff --git a/version.inc b/version.inc index 9e1971efd..12484d724 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-02-19.593 +2014-02-20.594 -- cgit v1.2.3 From a7194bc79a83bc7269a20a3c7ff2eb3d368527cb Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 20 Feb 2014 01:44:29 -0800 Subject: fix the broken hublocs in an update --- boot.php | 2 +- install/update.php | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/boot.php b/boot.php index 1d8ec2143..e7f583b44 100755 --- a/boot.php +++ b/boot.php @@ -46,7 +46,7 @@ define ( 'RED_PLATFORM', 'Red Matrix' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1097 ); +define ( 'DB_UPDATE_VERSION', 1098 ); define ( 'EOL', '
' . "\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/install/update.php b/install/update.php index ccfec9ddf..3e39a5b4c 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ Date: Thu, 20 Feb 2014 01:49:40 -0800 Subject: use the medium size photo on the nav bar if that photo stays larger, as the small one usually looks awful when you scale it up. --- include/nav.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nav.php b/include/nav.php index 8fef4a1f9..dd15ff411 100644 --- a/include/nav.php +++ b/include/nav.php @@ -95,7 +95,7 @@ EOT; if($observer) { $userinfo = array( - 'icon' => $observer['xchan_photo_s'], + 'icon' => $observer['xchan_photo_m'], 'name' => $observer['xchan_addr'], ); } -- cgit v1.2.3