From 34d79fcfc8e8dc2e0bef86a8ff598238e53af749 Mon Sep 17 00:00:00 2001
From: Daniel Winzen <daniel@danwin1210.de>
Date: Sun, 9 Jul 2023 12:44:04 +0200
Subject: [PATCH] Fixes #137 and #138

---
 chat.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/chat.php b/chat.php
index c44576e..0f9f9e7 100644
--- a/chat.php
+++ b/chat.php
@@ -3775,13 +3775,13 @@ function save_setup(array $C): void
 {
 	global $db;
 	//sanity checks and escaping
-	foreach($C['msg_settings'] as $setting){
+	foreach($C['msg_settings'] as $setting => $title){
 		$_POST[$setting]=htmlspecialchars($_POST[$setting]);
 	}
-	foreach($C['number_settings'] as $setting){
+	foreach($C['number_settings'] as $setting => $title){
 		settype($_POST[$setting], 'int');
 	}
-	foreach($C['colour_settings'] as $setting){
+	foreach($C['colour_settings'] as $setting => $title){
 		if(preg_match('/^#([a-f0-9]{6})$/i', $_POST[$setting], $match)){
 			$_POST[$setting]=$match[1];
 		}else{