Skip to content

Commit

Permalink
Sunrise: Don't redirect to a deleted site. (#1384)
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 authored Oct 4, 2024
1 parent ad61ccf commit 401a998
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions public_html/wp-content/sunrise-wordcamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,12 @@ function get_latest_site( string $domain ) {
SELECT `blog_id`, `domain`, `path`
FROM $wpdb->blogs
WHERE
( domain = %s AND path != '/' ) OR -- Match city/year format.
( domain LIKE %s AND path = '/' ) -- Match year.city format.
( public AND NOT deleted ) -- Deleted sites should be skipped
AND
(
( domain = %s AND path != '/' ) OR -- Match city/year format.
( domain LIKE %s AND path = '/' ) -- Match year.city format.
)
ORDER BY path DESC, domain DESC
LIMIT 1;",
$domain,
Expand Down

0 comments on commit 401a998

Please sign in to comment.