Skip to content
Permalink
Browse files

fix handling of ?gender? during Character registration (fixes #154)

  • Loading branch information
coderkun committed Apr 10, 2016
1 parent 1925547 commit 814b88c787743615fb3b0c459b95148bb76a7f19
Showing with 3 additions and 2 deletions.
  1. +3 −2 controllers/CharactersController.inc
@@ -288,6 +288,7 @@
if($this->Characters->characterNameExists($charactername)) {
$validation = $this->Validation->addValidationResult($validation, 'charactername', 'exist', true);
}
$gender = $this->request->getPostParam('gender');
// Validate type
$typeIndex = null;
@@ -303,7 +304,7 @@
}
// 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);
}
@@ -335,7 +336,7 @@
$this->Auth->getUserId(),
$types[$typeIndex]['id'],
$charactername,
$gender
intval($gender)
);
$character = $this->Characters->getCharacterById(
$characterId

0 comments on commit 814b88c

Please sign in to comment.
You can’t perform that action at this time.