PHP bug #53632 and CI Validation class

Entering the value of 2.2250738585072011e-308 in a contact form field and running that field through the CI Validation class hangs PHP. So it seems that the form field value is being interpreted as a float?

This all causes a "hang". The only way to avoid it is to remove the rule altogether.

$this->form_validation->set_rules('firstname', $this->lang->line('firstname'), '');
$this->form_validation->set_rules('firstname', $this->lang->line('firstname'), 'trim|required');

This is quite serious, any solutions for this?


[eluser]Phil Sturgeon[/eluser]
Sorry, not sure I follow your example. If you send 2.2250738585072011e-308 in firstname (which is probably varchar) it somehow get's treated as a float and hangs?

Yep, simple contact form with firstname, lastname, email, etc. If I enter that value in the firstname field, it hangs when it reaches

If I comment out the firstname validation rule then everything passes and the message is delivered.

There's no DB interaction going on.

I realize this is a PHP problem since just putting
$d = 2.2250738585072011e-308;
in a controller also hangs the system.

It's just weird that the problem occurs when you run it through the validation class.

We're fixing all our sites by putting this in the main index.php. Other, non CI sites on our server are a little harder to fix.

[eluser]Phil Sturgeon[/eluser]
Ahh this is the (one and only) bug that 5.2.17 / 5.3.5 fixes. I'll have a look and see if there is anything simple and realistic we can do for CI Reactor.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.