You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
Whenever $value is of float type it's cast into integer when used as a key in static::$cacheEncode[$value]
Why it is important ? See case:
Building url on page, $this->url('route_name1', array('param1' => 6.123, 'param2' => 7); static::$cacheEncode content is array(6 => 6.123, 7 => 7)
ends with url /route-name1/6.123/7
building second url on page $this->url('route_name2', array('param1' => 6, 'param2' => 'test'); static::$cacheEncode content is array(6 => 6.123, 7 => 7, 'test' => 'test')
ends with url /route-name2/6.123/test since cached encoded value is used.
this happens for PHP 5.3.10 and most likely for newer versions,
see PHP documentation
The key can either be an integer or a string. The value can be of any type.
...
Floats are also cast to integers, which means that the fractional part will be truncated. E.g. the key 8.7 will actually be stored under 8.
Zend/Mvc/Router/Http/Segment::encode#L429
Whenever
$value
is of float type it's cast into integer when used as a key instatic::$cacheEncode[$value]
Why it is important ? See case:
Building url on page,
$this->url('route_name1', array('param1' => 6.123, 'param2' => 7);
static::$cacheEncode
content isarray(6 => 6.123, 7 => 7)
ends with url /route-name1/6.123/7
building second url on page
$this->url('route_name2', array('param1' => 6, 'param2' => 'test');
static::$cacheEncode
content isarray(6 => 6.123, 7 => 7, 'test' => 'test')
ends with url /route-name2/6.123/test since cached encoded value is used.
this happens for PHP 5.3.10 and most likely for newer versions,
see PHP documentation
Fix proposal:
The text was updated successfully, but these errors were encountered: