Skip to content
Browse files

Update library/Zend/Form/Element/Range.php

This does not give the required result. It gives the isset result which is a boolean true or false.
(isset($this->attributes['min'])) ?: 0

This does work. It adds the value as expected.
(isset($this->attributes['min'])) ? $this->attributes['min'] : 0, 
  • Loading branch information...
1 parent 3a4cee6 commit 9a4571fc09900b13959c10e77ed79151ef484d32 @xtreamwayz xtreamwayz committed Sep 4, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 library/Zend/Form/Element/Range.php
View
8 library/Zend/Form/Element/Range.php
@@ -53,12 +53,12 @@ protected function getValidators()
}
$validators[] = new GreaterThanValidator(array(
- 'min' => (isset($this->attributes['min'])) ?: 0,
+ 'min' => (isset($this->attributes['min'])) ? $this->attributes['min'] : 0,
'inclusive' => $inclusive
));
$validators[] = new LessThanValidator(array(
- 'max' => (isset($this->attributes['max'])) ?: 100,
+ 'max' => (isset($this->attributes['max'])) ? $this->attributes['max'] : 100,
'inclusive' => $inclusive
));
@@ -67,8 +67,8 @@ protected function getValidators()
|| 'any' !== $this->attributes['step']
) {
$validators[] = new StepValidator(array(
- 'baseValue' => (isset($this->attributes['min'])) ?: 0,
- 'step' => (isset($this->attributes['step'])) ?: 1,
+ 'baseValue' => (isset($this->attributes['min'])) ? $this->attributes['min'] : 0,
+ 'step' => (isset($this->attributes['step'])) ? $this->attributes['step'] : 1,
));
}

0 comments on commit 9a4571f

Please sign in to comment.
Something went wrong with that request. Please try again.