mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-01 18:14:23 +00:00
Fixed a bug in the hero's mansion
You can't assign an empty name to an hero anymore. The new name will be displayed correctly (instead of the old name) after renaming your hero.
This commit is contained in:
@@ -12,10 +12,11 @@
|
||||
include_once("GameEngine/Data/hero_full.php");
|
||||
global $database;
|
||||
|
||||
if (isset($_POST['name'])) {
|
||||
$_POST['name'] = stripslashes($_POST['name']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `name`='".($database->escape($_POST['name']))."' where `uid`='".$database->escape($session->uid)."' AND dead = 0") or die("ERROR:".mysqli_error($database->dblink));
|
||||
echo "".NAME_CHANGED."";
|
||||
if (isset($_POST['name']) && !empty($_POST['name'])) {
|
||||
$_POST['name'] = $database->escape(stripslashes($_POST['name']));
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `name`='".$_POST['name']."' where `uid`='".$database->escape($session->uid)."' AND dead = 0") or die("ERROR:".mysqli_error($database->dblink));
|
||||
$hero_info['name'] = $_POST['name'];
|
||||
echo "".NAME_CHANGED."";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user