Welcome Guest, Not a member yet? Register   Sign In
Big Numbers
#1

[eluser]jshvrsn[/eluser]
I seem to have troubles with CI when sending certain strings as function parameters. It looks like any string that looks like an exponential number and is greater than a certain size kills CI. It doesn't matter what's in the function, in fact, the function can be empty.

For Example:

The string "1E47" can be sent fine, but "1E48" cannot.

http://myip/index.php/mycontroller/myfunction/1E47 == OK
http://myip/index.php/mycontroller/myfunction/1E48 == FAIL

function myfunction( $x )
{
}

Am I doing something wrong?

Thanks.
#2

[eluser]Seppo[/eluser]
Works fine here using PHP 5.2.5... which PHP version are you using?
HAve you tried it outside CI interface, in plain PHP?
#3

[eluser]jshvrsn[/eluser]
I'm using PHP 5.2.5 running as FCGI under Lighttpd 1.4.15 on a ARM processor running Linux. I also happen to be using CI 1.5.4.

What I found is that in the _set_route_mapping() function in Router.php, there is this little chunk of code:
Code:
// Explode the URI Segments. The individual segments will
// be stored in the $this->segments array.    
foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val)
{
   // Filter segments for security
   $val = trim($this->_filter_uri($val));

   if ($val != '')
      $this->segments[] = (string) $val;
}
and if I change
Code:
if ($val != '')
to
Code:
if ($val !== '')
then it works fine.

I don't see this problem on my desktop machine running Apache. Could it somehow be an issue in Lighttpd?

I tried CI 1.6.1 today and see the same problem. However, the _set_route_mapping() function has been changed, so I haven't found where to apply the fix yet.
#4

[eluser]bardelot[/eluser]
Is there any error/warning/notice message? What does var_dump($var) and var_dump('') return?
#5

[eluser]jshvrsn[/eluser]
No warnings, it just hangs.

var_dump( $val ) = string(4) "1E48"
var_dump( '' ) = string(0) ""
#6

[eluser]jshvrsn[/eluser]
I did a very simple test to narrow this down.

I made a file with this content:
Code:
<?php echo( "1E48" != '' ); ?>
Then I ran it from the command line. PHP hung. So I guess that proves the problem is somehow with my cross-compiled PHP.

Sorry for the distraction, I'll take my investigation over to the PHP site.

Thanks for trying to help me out!




Theme © iAndrew 2016 - Forum software by © MyBB