protected function getTokenLength()
{
if (($tokenLength = $this->getViewState('TokenLength')) === null) {
$minLength = $this->getMinTokenLength();
$maxLength = $this->getMaxTokenLength();
if ($minLength > $maxLength) {
$tokenLength = rand($maxLength, $minLength);
} else {
if ($minLength < $maxLength) {
$tokenLength = rand($minLength, $maxLength);
} else {
$tokenLength = $minLength;
}
}
$this->setViewState('TokenLength', $tokenLength);
}
return $tokenLength;
}