From 40304082bd34255bf244ea9cba78001dfdc5e20e Mon Sep 17 00:00:00 2001 From: Patrick Kuijvenhoven Date: Wed, 20 Jan 2021 23:45:40 +0100 Subject: [PATCH] fix(version): remove whitespace at end of APP_VERSION constant The Dockerfile contains `echo $VERSION > /version.txt`, where `echo` implicitly causes a newline at the end of the file. To avoid that, one could use `echo -n`, but then the file isn't nicely readable when doing a `cat` or something simular. This fix `rtrims` (i.e. "Strip whitespace (or other characters) from the end of a string") the contents of the version file. Fixes kanboard/kanboard#4708 --- app/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/functions.php b/app/functions.php index e5b2977be..d6f0c7a33 100644 --- a/app/functions.php +++ b/app/functions.php @@ -199,7 +199,7 @@ function build_app_version($ref, $commit_hash) if ($commit_hash !== '$Format:%H$') { return 'master.'.$commit_hash; } else if (file_exists('/version.txt')) { - return file_get_contents('/version.txt'); + return rtrim(file_get_contents('/version.txt')); } return 'master.unknown_revision';