Thanks to visit codestin.com
Credit goes to github.com

Skip to content

NumberToLocalizedStringTransformer uses INF to check value, but INF is float(0) on Solaris #8246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Geckow opened this issue Jun 11, 2013 · 1 comment

Comments

@Geckow
Copy link

Geckow commented Jun 11, 2013

This took me some time to debug, as the form-element only reports "value is invalid" and no exceptions were in the profiler, but in NumberToLocalizedStringTransformer line 130+

    if ($result >= INF || $result <= -INF) {
        throw new TransformationFailedException('I don\'t have a clear idea what infinity looks like');
    }

values are reverseTransform'ed and tested against INF. On Solaris however, for years INF equals float(0), so the above test always returns true making it impossible to use the Form framework on Solaris hosts.

@fabpot fabpot closed this as completed Jun 23, 2013
fabpot added a commit that referenced this issue Jun 23, 2013
* 2.2:
  [Form] fixed INF usage which does not work on Solaris (closes #8246)
  Fix grammar
  bumped Symfony version to 2.2.4
  updated VERSION for 2.2.3
  update CONTRIBUTORS for 2.2.3
  updated CHANGELOG for 2.2.3
  [Process] Disable exception on stream_select timeout
  [HttpFoundation] fixed issue with session_regenerate_id (closes #7380)
  [DomCrawler] added a note about the default charset
  [Console] fixed regression when calling a command foo:bar if there is another one like foo:bar:baz (closes #8245)
  force the Content-Type to html in the web profiler controllers

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
fabpot added a commit that referenced this issue Jun 23, 2013
* 2.3: (33 commits)
  [Form] fixed INF usage which does not work on Solaris (closes #8246)
  Fix grammar
  Removed PHP 5.5 from the allowed failures.
  [Intl] Fixed tests failing on PHP 5.5
  bumped Symfony version to 2.2.4
  updated VERSION for 2.2.3
  update CONTRIBUTORS for 2.2.3
  updated CHANGELOG for 2.2.3
  [DependencyInjection] Replaced try/catch block with an @ExpectedException annotation in a test.
  [CssSelector] tweaked README file (closes #8287)
  added a node about HTML extension in readme
  [Console] Fixed the table rendering with multi-byte strings.
  Feature/fix unit tests
  [Process] Disable exception on stream_select timeout
  [HttpFoundation] fixed issue with session_regenerate_id (closes #7380)
  [DomCrawler] added a note about the default charset
  Throw exception if value is passed to VALUE_NONE input, long syntax
  fixed date type format pattern regex
  [Security] fixed usage of the salt for the bcrypt encoder (refs #8210)
  [FrameworkBundle] tweaked previous merge (refs #8242)
  ...

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
@daviddesberg
Copy link

@fabpot As I noted here, doubles can be larger than PHP_INT_MAX, and if the value being transformed is a double, an unwarranted exception is thrown because of this change. Thus, if the constant INF is available, it should be used in favor of PHP_INT_MAX.

ostrolucky pushed a commit to ostrolucky/symfony that referenced this issue Mar 25, 2018
* 2.2:
  [Form] fixed INF usage which does not work on Solaris (closes symfony#8246)
  Fix grammar
  bumped Symfony version to 2.2.4
  updated VERSION for 2.2.3
  update CONTRIBUTORS for 2.2.3
  updated CHANGELOG for 2.2.3
  [Process] Disable exception on stream_select timeout
  [HttpFoundation] fixed issue with session_regenerate_id (closes symfony#7380)
  [DomCrawler] added a note about the default charset
  [Console] fixed regression when calling a command foo:bar if there is another one like foo:bar:baz (closes symfony#8245)
  force the Content-Type to html in the web profiler controllers

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
ostrolucky pushed a commit to ostrolucky/symfony that referenced this issue Mar 25, 2018
* 2.3: (33 commits)
  [Form] fixed INF usage which does not work on Solaris (closes symfony#8246)
  Fix grammar
  Removed PHP 5.5 from the allowed failures.
  [Intl] Fixed tests failing on PHP 5.5
  bumped Symfony version to 2.2.4
  updated VERSION for 2.2.3
  update CONTRIBUTORS for 2.2.3
  updated CHANGELOG for 2.2.3
  [DependencyInjection] Replaced try/catch block with an @ExpectedException annotation in a test.
  [CssSelector] tweaked README file (closes symfony#8287)
  added a node about HTML extension in readme
  [Console] Fixed the table rendering with multi-byte strings.
  Feature/fix unit tests
  [Process] Disable exception on stream_select timeout
  [HttpFoundation] fixed issue with session_regenerate_id (closes symfony#7380)
  [DomCrawler] added a note about the default charset
  Throw exception if value is passed to VALUE_NONE input, long syntax
  fixed date type format pattern regex
  [Security] fixed usage of the salt for the bcrypt encoder (refs symfony#8210)
  [FrameworkBundle] tweaked previous merge (refs symfony#8242)
  ...

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants