Skip to content
This repository has been archived by the owner on Jul 3, 2022. It is now read-only.

Commit

Permalink
fix handling of ?gender? during Character registration (fixes #154)
Browse files Browse the repository at this point in the history
  • Loading branch information
coderkun committed Apr 10, 2016
1 parent 1925547 commit 814b88c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/CharactersController.inc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@
if($this->Characters->characterNameExists($charactername)) { if($this->Characters->characterNameExists($charactername)) {
$validation = $this->Validation->addValidationResult($validation, 'charactername', 'exist', true); $validation = $this->Validation->addValidationResult($validation, 'charactername', 'exist', true);
} }
$gender = $this->request->getPostParam('gender');


// Validate type // Validate type
$typeIndex = null; $typeIndex = null;
Expand All @@ -303,7 +304,7 @@
} }


// Validate gender // Validate gender
if(is_null($gender) || !in_array(intval($gender), array(0, 1))) { if(is_null($gender) || ($gender !== "0" && $gender !== "1")) {
$validation = $this->Validation->addValidationResult($validation, 'gender', 'correct', false); $validation = $this->Validation->addValidationResult($validation, 'gender', 'correct', false);
} }


Expand Down Expand Up @@ -335,7 +336,7 @@
$this->Auth->getUserId(), $this->Auth->getUserId(),
$types[$typeIndex]['id'], $types[$typeIndex]['id'],
$charactername, $charactername,
$gender intval($gender)
); );
$character = $this->Characters->getCharacterById( $character = $this->Characters->getCharacterById(
$characterId $characterId
Expand Down

0 comments on commit 814b88c

Please sign in to comment.