fix the broken hublocs in an update
This commit is contained in:
parent
6eb971656e
commit
a7194bc79a
2
boot.php
2
boot.php
@ -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' );
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user