Welcome Guest, Not a member yet? Register   Sign In
URL bug - A segment of '0' returns false?
#1

[eluser]Rokkitt[/eluser]
Seriously. This is causing me all kind of headaches. Have the same code locally as I do on my server. Both are running PHP 5.4.

config/routes.php

Code:
$route['default_controller'] = "frontend/run";
$route['send_contact/(:num)'] = "frontend/send_contact/$1";
$route['404_override'] = 'frontend/run';

controllers/frontend.php > run()

Code:
public function run()
{
// Get Page
var_dump($this->uri->segment(1)); exit;
}

Tests

mysite.com/blah
// Returns: string(4) "blah"

mysite.com/1
// Returns: string(1) "1"

On my server.. broken..

mysite.com/0
// Returns: bool(false)

Locally.. works..

mysite.com/0
// Returns: string(0) "0"

Can anyone else recreate this? Any idea why this is happening?


Messages In This Thread
URL bug - A segment of '0' returns false? - by El Forum - 06-07-2013, 06:09 AM
URL bug - A segment of '0' returns false? - by El Forum - 06-07-2013, 06:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB