mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:35:30 +00:00
hubloc_mark_as_down() - also set site_dead
This commit is contained in:
parent
a1ed5b903a
commit
1a595f4273
1 changed files with 7 additions and 0 deletions
|
@ -247,6 +247,7 @@ function hubloc_change_primary($hubloc) {
|
|||
*
|
||||
* We use the post url to distinguish between http and https hublocs.
|
||||
* The https might be alive, and the http dead.
|
||||
* Also set site_dead for the corresponding entry in the site table
|
||||
*
|
||||
* @param string $posturl Hubloc callback url which to disable
|
||||
*/
|
||||
|
@ -255,6 +256,12 @@ function hubloc_mark_as_down($posturl) {
|
|||
intval(HUBLOC_OFFLINE),
|
||||
dbesc($posturl)
|
||||
);
|
||||
// extract the baseurl and set site.site_dead to match
|
||||
$m = parse_url($posturl);
|
||||
$h = $m['scheme'] . '://' . $m['host'];
|
||||
$r = q("update site set site_dead = 1 where site_url = '%s'",
|
||||
dbesc($h)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue