Skip to content
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

Fixed 2 strpos warnings when using mod_rewrite #967

Closed
wants to merge 1 commit into from
Closed

Fixed 2 strpos warnings when using mod_rewrite #967

wants to merge 1 commit into from

Conversation

bogglez
Copy link

@bogglez 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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@it-can
Copy link
Contributor

it-can commented Jan 25, 2012

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

@bogglez
Copy link
Author

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';

@it-can
Copy link
Contributor

it-can commented Jan 25, 2012

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

@bogglez
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants