From e76ccf4f3cbe8fa7a27fee9b5d7dfb8997dc60ef Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 14:36:46 +0000 Subject: [PATCH] Guard against empty installed_version when php -r fails in nextcloud entrypoint.sh Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/48f0714b-3f49-4e28-b48e-d58fea2e881e Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com> --- Containers/nextcloud/entrypoint.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index 198f892e..3c6f2c30 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -115,6 +115,11 @@ rm -f "$test_file" if [ -f /var/www/html/version.php ]; then # shellcheck disable=SC2016 installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')" + if [ -z "$installed_version" ]; then + echo "Could not determine the installed Nextcloud version via php -r. The PHP installation might be broken." + echo "Please check the container logs and your PHP installation." + exit 1 + fi else installed_version="0.0.0.0" fi