From 841632b3fc0f10923253a169bd26f2f38a85e505 Mon Sep 17 00:00:00 2001 From: Shadow Date: Wed, 26 Feb 2014 07:32:05 +0200 Subject: [PATCH] Update Profile.php --- GameEngine/Profile.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/GameEngine/Profile.php b/GameEngine/Profile.php index 6aa6174a..fede6cd1 100644 --- a/GameEngine/Profile.php +++ b/GameEngine/Profile.php @@ -79,11 +79,12 @@ class Profile { $birthday = $post['jahr'].'-'.$post['monat'].'-'.$post['tag']; $database->submitProfile($database->RemoveXSS($post['uid']),$database->RemoveXSS($post['mw']),$database->RemoveXSS($post['ort']),$database->RemoveXSS($birthday),$database->RemoveXSS($post['be2']),$database->RemoveXSS($post['be1'])); $varray = $database->getProfileVillages($post['uid']); - for($i=0;$i<=count($varray)-1;$i++) { - $k = "".$post['dname'.$i].""; - $name = preg_replace("/[^a-zA-Z0-9_-\s]/", "", $k); - $database->setVillageName($database->RemoveXSS($varray[$i]['wref']),$name); - } + for($i=0;$i<=count($varray)-1;$i++) { + $k = trim($post['dname'.$i]); + $name = preg_replace("/[^a-zA-Z0-9_-\s]/", "", $k); + $database->setVillageName($database->RemoveXSS($varray[$i]['wref']),$name); + $database->setVillageName($database->RemoveXSS($varray[$i]['wref']),$k); + } header("Location: spieler.php?uid=".$post['uid']); }