From 4c59989236ee35be7f50b1df569193d7947508ed Mon Sep 17 00:00:00 2001 From: Chris Novakovic Date: Tue, 10 Jun 2025 13:38:08 +0100 Subject: [PATCH 1/2] Docker: harden updating of `php.ini` in entrypoint The Docker entrypoint scripts set values for the `upload_max_filesize` and `post_max_size` directives in `php.ini` based on the value of the `PHP_UPLOAD_LIMIT` environment variable, subject to the following restrictions: * Exactly one file matches `/etc/php/*/apache2/php.ini` (on Ubuntu) or `/etc/php*/php.ini` (on Alpine) - if, for example, more than one PHP package is installed in the base image, `PHP_UPLOAD_LIMIT` will not be honoured. * The `php.ini` file already sets a non-default value for the `upload_max_filesize` or `post_max_size` directives - this is currently the case for the configurations inherited from upstream, but is not guaranteed. If the default values are relied upon, `PHP_UPLOAD_LIMIT` will silently not be honoured (although the script output will claim that it is). Iterate over the lines outputted by `file(1)` so `PHP_UPLOAD_LIMIT` is honoured in all available `php.ini` files, and set `upload_max_filesize` and `post_max_size` regardless of whether they already have a value set. --- docker/startup.sh | 14 +++++++------- docker/startup_alpine.sh | 10 +++++++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/docker/startup.sh b/docker/startup.sh index 2ba4681870..5329e37c2c 100644 --- a/docker/startup.sh +++ b/docker/startup.sh @@ -100,13 +100,13 @@ chown -R docker:root /var/www/html/storage/framework/cache # Fix php settings if [ -v "PHP_UPLOAD_LIMIT" ] then - PHP_INI_FILE=$(find /etc/php/*/apache2/php.ini) - if [ -e $PHP_INI_FILE ] - then - echo "Changing upload limit to ${PHP_UPLOAD_LIMIT}M in ${PHP_INI_FILE}" - sed -i "s/^upload_max_filesize.*/upload_max_filesize = ${PHP_UPLOAD_LIMIT}M/" $PHP_INI_FILE - sed -i "s/^post_max_size.*/post_max_size = ${PHP_UPLOAD_LIMIT}M/" $PHP_INI_FILE - fi + find /etc/php -type f -name php.ini | while IFS= read -r ini; do + echo "Changing upload limit to ${PHP_UPLOAD_LIMIT}M in $ini" + sed -i \ + -e "s/^;\? *upload_max_filesize *=.*/upload_max_filesize = ${PHP_UPLOAD_LIMIT}M/" \ + -e "s/^;\? *post_max_size *=.*/post_max_size = ${PHP_UPLOAD_LIMIT}M/" \ + "$ini" + done fi # If the Oauth DB files are not present copy the vendor files over to the db migrations diff --git a/docker/startup_alpine.sh b/docker/startup_alpine.sh index cfb1d8e41c..bb9574f387 100644 --- a/docker/startup_alpine.sh +++ b/docker/startup_alpine.sh @@ -84,9 +84,13 @@ chown -R apache:root /var/www/html/storage/framework/cache # Fix php settings if [ ! -z "${PHP_UPLOAD_LIMIT}" ] then - echo "Changing upload limit to ${PHP_UPLOAD_LIMIT}" - sed -i "s/^upload_max_filesize.*/upload_max_filesize = ${PHP_UPLOAD_LIMIT}M/" /etc/php*/php.ini - sed -i "s/^post_max_size.*/post_max_size = ${PHP_UPLOAD_LIMIT}M/" /etc/php*/php.ini + find /etc -type f -name php.ini | while IFS= read -r ini; do + echo "Changing upload limit to ${PHP_UPLOAD_LIMIT}M in $ini" + sed -i \ + -e "s/^;\? *upload_max_filesize *=.*/upload_max_filesize = ${PHP_UPLOAD_LIMIT}M/" \ + -e "s/^;\? *post_max_size *=.*/post_max_size = ${PHP_UPLOAD_LIMIT}M/" \ + "$ini" + done fi # If the Oauth DB files are not present copy the vendor files over to the db migrations From da06e9afd59157d74945a142042694f211fe2d27 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 14 Jun 2025 17:40:14 +0100 Subject: [PATCH 2/2] Fixes #17177 - undefined title on asset maintenance Signed-off-by: snipe --- resources/views/partials/bootstrap-table.blade.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index fc9e752e51..74704a00e0 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -386,15 +386,21 @@ if ((row.available_actions) && (row.available_actions.delete === true)) { // use the asset tag if no name is provided - var name_for_box = row.name - if (row.name=='') { + + if (row.name) { + var name_for_box = row.name + } else if (row.title) { + var name_for_box = row.title + } else if (row.asset_tag) { var name_for_box = row.asset_tag } + + actions += '' + '{{ trans('general.delete') }} '; } else {