Part of the EllisLab Network

Bug Report

Permitted URI chars fails if you insert comma

Date: 02/18/2008 Severity: Trivial
Status: Bogus Reporter: Gyorgy Fekete
Version: 1.6.1
Keywords: Libraries, URI Class

Description

In the config file if you insert a comma (,) to the end of the permitted uri chars string then the preg_match will fail with an Out of range error.

This only happens if you insert the comma to the end of the string. If you insert it for ex. before the ~ sign in the permitted uri chars string then it will work.

Code Sample

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-,';

Expected Result

To work fine.

Actual Result

Message: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 17

Comment on Bug Report

Page 1 of 1 pages
Posted by: Derek Allard on 18 February 2008 3:33pm
Derek Allard's avatar

Greetings Gyorgy,

I do not see a forum thread associated with this bug report, and it looks like it may not be a bug.  Have you first read the bug reporting guidelines and used the Bug Report Forum to get help confirming that this is a bug before reporting?

Thanks!

Posted by: Derek Jones on 18 February 2008 3:34pm
Derek Jones's avatar

You’re making your own regular expression match there, Gyorgy, so it will indeed have to be syntactically correct.  To help prevent developers from making the above mistake, though, I’ll go ahead and escape the - in the default expression.

Posted by: Gyorgy Fekete on 18 February 2008 4:07pm
no avatar

Well I don’t consider $config[‘permitted_uri_chars’] as a regular expression, I as a developer don’t care how this string is handled by CodeIgniter.

Posted by: Derek Jones on 18 February 2008 4:14pm
Derek Jones's avatar

I would have thought that a-z and 0-9 would have indicated that to you, but now you know.

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?