Merge remote-tracking branch 'upstream/master'

This commit is contained in:
zottel 2014-02-20 11:17:07 +01:00
commit 79c566bda3
6 changed files with 33 additions and 14 deletions

View File

@ -46,7 +46,7 @@ define ( 'RED_PLATFORM', 'Red Matrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 ); define ( 'ZOT_REVISION', 1 );
define ( 'DB_UPDATE_VERSION', 1097 ); define ( 'DB_UPDATE_VERSION', 1098 );
define ( 'EOL', '<br />' . "\r\n" ); define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );

View File

@ -95,7 +95,7 @@ EOT;
if($observer) { if($observer) {
$userinfo = array( $userinfo = array(
'icon' => $observer['xchan_photo_s'], 'icon' => $observer['xchan_photo_m'],
'name' => $observer['xchan_addr'], 'name' => $observer['xchan_addr'],
); );
} }

View File

@ -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. // 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' ", $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; 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. // new hub claiming to be primary. Make it so.
if(intval($location['primary'])) { if(intval($location['primary'])) {
@ -840,9 +842,11 @@ function import_xchan($arr,$ud_flags = 1) {
); );
$what .= 'newhub '; $what .= 'newhub ';
$changed = true; $changed = true;
} }
// get rid of any hubs we have for this channel which weren't reported. // get rid of any hubs we have for this channel which weren't reported.
if($xisting) { if($xisting) {
foreach($xisting as $x) { foreach($xisting as $x) {
if(! array_key_exists('updated',$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? // Are we a directory server of some kind?

View File

@ -1,6 +1,6 @@
<?php <?php
define( 'UPDATE_VERSION' , 1097 ); define( 'UPDATE_VERSION' , 1098 );
/** /**
* *
@ -1084,3 +1084,19 @@ function update_r1096() {
return UPDATE_FAILED; return UPDATE_FAILED;
} }
function update_r1097() {
// fix some mangled hublocs from a bug long ago
$r = q("select hubloc_id, hubloc_addr from hubloc where hubloc_addr like '%/%'");
if($r) {
foreach($r as $rr) {
q("update hubloc set hubloc_addr = '%s' where hubloc_id = %d limit 1",
dbesc(substr($rr['hubloc_addr'],0,strpos($rr['hubloc_addr'],'/'))),
intval($rr['hubloc_id'])
);
}
}
return UPDATE_SUCCESS;
}

View File

@ -261,7 +261,7 @@ function settings_post(&$a) {
$maxreq = ((x($_POST,'maxreq')) ? intval($_POST['maxreq']) : 0); $maxreq = ((x($_POST,'maxreq')) ? intval($_POST['maxreq']) : 0);
$expire = ((x($_POST,'expire')) ? intval($_POST['expire']) : 0); $expire = ((x($_POST,'expire')) ? intval($_POST['expire']) : 0);
$def_group = ((x($_POST,'group-selection')) ? notags(trim($_POST['group-selection'])) : ''); $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_items = ((x($_POST,'expire_items')) ? intval($_POST['expire_items']) : 0);
$expire_starred = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0); $expire_starred = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0);

View File

@ -1 +1 @@
2014-02-19.593 2014-02-20.594