v1.8.0
This commit is contained in:
parent
c7a8d9efcc
commit
1460cb231f
6 changed files with 63 additions and 16 deletions
|
|
@ -358,10 +358,35 @@ class Robotstxt_Manager_Core_Client {
|
|||
$raw_expires_at = $row['expires_at'] ?? '';
|
||||
$raw_bound = $row['bound_domain'] ?? '';
|
||||
|
||||
$status = is_string( $raw_status ) ? $raw_status : '';
|
||||
$expires_at = is_string( $raw_expires_at ) ? $raw_expires_at : '';
|
||||
$bound = is_string( $raw_bound ) ? $raw_bound : '';
|
||||
|
||||
// Group multi-license rows (Core 1.14.0+: one row per domain)
|
||||
// into one entry per slug: any-active wins, first bound domain
|
||||
// shown, license count kept for the pill.
|
||||
if ( isset( $rows[ $slug ] ) ) {
|
||||
$existing = $rows[ $slug ];
|
||||
|
||||
if ( 'active' === $status && 'active' !== $existing['status'] ) {
|
||||
$existing['status'] = 'active';
|
||||
$existing['expires_at'] = $expires_at;
|
||||
}
|
||||
|
||||
if ( '' === $existing['bound_domain'] && '' !== $bound ) {
|
||||
$existing['bound_domain'] = $bound;
|
||||
}
|
||||
|
||||
$existing['license_count'] = (int) $existing['license_count'] + 1;
|
||||
$rows[ $slug ] = $existing;
|
||||
continue;
|
||||
}
|
||||
|
||||
$rows[ $slug ] = array(
|
||||
'status' => is_string( $raw_status ) ? $raw_status : '',
|
||||
'expires_at' => is_string( $raw_expires_at ) ? $raw_expires_at : '',
|
||||
'bound_domain' => is_string( $raw_bound ) ? $raw_bound : '',
|
||||
'status' => $status,
|
||||
'expires_at' => $expires_at,
|
||||
'bound_domain' => $bound,
|
||||
'license_count' => 1,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue