From 339c4794028fa31e50d9eaadb5e7128bf3fbdca2 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 6 Jul 2026 13:39:07 +0200 Subject: [PATCH 1/3] Fix fatal error from undefined function __e() The error path in the authenticate form template called __e(), which does not exist in WordPress, causing a fatal error whenever the current user could not be determined. Use esc_html_e() instead and close the login page with login_footer() before exiting. Fixes #313 --- templates/indieauth-authenticate-form.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/indieauth-authenticate-form.php b/templates/indieauth-authenticate-form.php index e785b80..73f74b2 100644 --- a/templates/indieauth-authenticate-form.php +++ b/templates/indieauth-authenticate-form.php @@ -8,7 +8,8 @@ ); $user_website = esc_url( get_url_from_user( $current_user->ID ) ); if ( ! $user_website ) { - __e( 'The application cannot sign you in as WordPress cannot determine the current user', 'indieauth' ); + esc_html_e( 'The application cannot sign you in as WordPress cannot determine the current user', 'indieauth' ); + login_footer(); exit; } From 319603ee7db55c08adb8653ef00bc685c6ab49de Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 6 Jul 2026 13:41:57 +0200 Subject: [PATCH 2/3] Fully qualify function calls in the error path --- templates/indieauth-authenticate-form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/indieauth-authenticate-form.php b/templates/indieauth-authenticate-form.php index 73f74b2..f02e046 100644 --- a/templates/indieauth-authenticate-form.php +++ b/templates/indieauth-authenticate-form.php @@ -8,8 +8,8 @@ ); $user_website = esc_url( get_url_from_user( $current_user->ID ) ); if ( ! $user_website ) { - esc_html_e( 'The application cannot sign you in as WordPress cannot determine the current user', 'indieauth' ); - login_footer(); + \esc_html_e( 'The application cannot sign you in as WordPress cannot determine the current user', 'indieauth' ); + \login_footer(); exit; } From 347aa8afca67d09968f9648d25b6dd653aa86c5b Mon Sep 17 00:00:00 2001 From: Dominik Schwind Date: Tue, 7 Jul 2026 20:55:09 +0200 Subject: [PATCH 3/3] Call the function directly as the global variable is not set in this context --- templates/indieauth-authenticate-form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/indieauth-authenticate-form.php b/templates/indieauth-authenticate-form.php index e785b80..304c8b4 100644 --- a/templates/indieauth-authenticate-form.php +++ b/templates/indieauth-authenticate-form.php @@ -6,7 +6,7 @@ '', $login_errors ); -$user_website = esc_url( get_url_from_user( $current_user->ID ) ); +$user_website = esc_url( get_url_from_user( wp_get_current_user()?->ID ) ); if ( ! $user_website ) { __e( 'The application cannot sign you in as WordPress cannot determine the current user', 'indieauth' ); exit;