Skip to content

Commit 64e4c3b

Browse files
Update docker/entrypoint.sh
Co-authored-by: qodo-merge-for-open-source[bot] <189517486+qodo-merge-for-open-source[bot]@users.noreply.github.com>
1 parent fd06e94 commit 64e4c3b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docker/entrypoint.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ if [[ "$TELEMETRY" == "true" && ("$MODE" == "frontend" || "$MODE" == "standalone
7979
if [ "$ENABLE_ID_OBFUSCATION" == "true" ]; then
8080
sed -i s/\$enable_id_obfuscation\ =\ .*\;/\$enable_id_obfuscation\ =\ true\;/g /var/www/html/results/telemetry_settings.php
8181
if [ ! -z "$OBFUSCATION_SALT" ]; then
82-
echo "<?php" > /var/www/html/results/idObfuscation_salt.php
83-
echo "\$OBFUSCATION_SALT = $OBFUSCATION_SALT;" >> /var/www/html/results/idObfuscation_salt.php
82+
if [[ "$OBFUSCATION_SALT" =~ ^0x[0-9a-fA-F]+$ ]]; then
83+
echo "<?php" > /var/www/html/results/idObfuscation_salt.php
84+
echo "\$OBFUSCATION_SALT = $OBFUSCATION_SALT;" >> /var/www/html/results/idObfuscation_salt.php
85+
else
86+
echo "WARNING: Invalid OBFUSCATION_SALT format. It must be a hex string (e.g., 0x1234abcd). Using random salt." >&2
87+
fi
8488
fi
8589
fi
8690

0 commit comments

Comments
 (0)