Skip to content

Commit

Permalink
404: Pass correct get_site_url param to avoid infinite loop (#98)
Browse files Browse the repository at this point in the history
The first param to `get_site_url()` should be a site ID, or `null` for the current site. Passing a string can cause a `switch_to_blog( 0 )` in some circumstances. That breaks SQL queries because the table doesn't exist. The first broken query results in a `wp_die()`, but that leads to more queries which in turn call `wp_die()`.

Passing `null` fixes the error while preserving the original intent from #54 (comment).
  • Loading branch information
iandunn authored Aug 22, 2023
1 parent 97609a6 commit d75152c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
printf(
/* translators: %s is the site URL. */
wp_kses_post( __( 'Go to <a href="%s">the homepage</a> or try searching using the field below.', 'wporg' ) ),
esc_url( get_site_url( '/' ) )
esc_url( get_site_url( null, '/' ) )
);
?>
</p>
Expand Down

0 comments on commit d75152c

Please sign in to comment.