Fixed 2 strpos warnings when using mod_rewrite #967

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

bogglez commented Jan 25, 2012

Screenshot of warnings:
screencap

- elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0)
+ $script_name = $_SERVER['SCRIPT_NAME'];
+
+ if (!empty($uri) && !empty($script_name))
@it-can

it-can Jan 25, 2012

Contributor

Please follow style guide... if ( ! empty()

Contributor

it-can commented Jan 25, 2012

What .htaccess and what config.php ($config['uri_protocol']) do you use?

bogglez commented Jan 25, 2012

No .htaccess, I set it with the VirtualHost in httpd.conf:
RewriteEngine on
RewriteCond $1 !^(index.php|images|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

$config['uri_protocol'] = 'AUTO';

Contributor

it-can commented Jan 25, 2012

If you set: $config['uri_protocol'] = 'QUERY_STRING';

bogglez commented Jan 25, 2012

Yeah, QUERY_STRING works. Sorry I'm new to CodeIgniter.
Might want to warn users they didn't configure it properly instead of silently failing, though. I guess I only got that error because I set PHP to report all warnings.

@narfbg narfbg closed this Oct 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment