From 7fd634b420b0114071b32f518d4497d7e042de49 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 3 Mar 2025 23:33:58 +0700 Subject: [PATCH 1/2] [ticket/17480] Fix PHP fatal error in version check failure PHPBB-17480 --- phpBB/includes/acp/acp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index e284b29146..2d4cb10c73 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -485,7 +485,7 @@ class acp_main 'UPGRADE_INSTRUCTIONS' => !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false, )); } - catch (\RuntimeException $e) + catch (\phpbb\exception\runtime_exception $e) { $message = call_user_func_array(array($user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); $template->assign_vars(array( From d9136469ea6a3833cf1ba7776717ec32b8bafa03 Mon Sep 17 00:00:00 2001 From: rxu Date: Tue, 4 Mar 2025 01:06:46 +0700 Subject: [PATCH 2/2] [ticket/17480] Catch runtime_exception instead of exception_interface Catch runtime_exception instead of exception_interface for extensions version check failures. PHPBB-17480 --- phpBB/includes/acp/acp_extensions.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 277e7bdf48..0c9cdbeff4 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -12,6 +12,7 @@ */ use phpbb\exception\exception_interface; +use phpbb\exception\runtime_exception; use phpbb\exception\version_check_exception; /** @@ -344,7 +345,7 @@ class acp_extensions $this->template->assign_block_vars('updates_available', $updates_available); } - catch (exception_interface $e) + catch (runtime_exception $e) { $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); @@ -423,7 +424,7 @@ class acp_extensions $enabled_extension_meta_data[$name]['S_VERSIONCHECK'] = true; $enabled_extension_meta_data[$name]['U_VERSIONCHECK_FORCE'] = $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name')); } - catch (exception_interface $e) + catch (runtime_exception $e) { // Ignore exceptions due to the version check } @@ -433,7 +434,7 @@ class acp_extensions $enabled_extension_meta_data[$name]['S_VERSIONCHECK'] = false; } } - catch (exception_interface $e) + catch (runtime_exception $e) { $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); $this->template->assign_block_vars('disabled', array( @@ -501,7 +502,7 @@ class acp_extensions { $disabled_extension_meta_data[$name]['S_VERSIONCHECK'] = false; } - catch (exception_interface $e) + catch (runtime_exception $e) { $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); $this->template->assign_block_vars('disabled', array( @@ -572,7 +573,7 @@ class acp_extensions { $available_extension_meta_data[$name]['S_VERSIONCHECK'] = false; } - catch (exception_interface $e) + catch (runtime_exception $e) { $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters())); $this->template->assign_block_vars('not_installed', array(