We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Ignoring Numeric values in segment uri?

Development and Programming

Carl W Crawley's avatar
Carl W Crawley
136 posts
14 years ago
Carl W Crawley's avatar Carl W Crawley

Hi All,

I have an addon which is capturing the segment uri data with

$this->EE->uri->segment(2)

and

$this->EE->uri->segment(3)

the url is

http://site.com/_ajax/test/345/

I’ve output a print_r of segment(2) and it’s correctly telling me it’s ‘test’, but when I try to output segment(3), it’s just blank.

However, if I change the value of segment(3) to /_ajax/test/ab345/ it returns ‘ab345’.

Why would it not be returning a numerical value for the segment uri? this was working when the site ran 2.1.3, but upgrading to 2.2.1 has created this bug - but it could well just be a coincidence.

Thanks,

Carl

[Mod Edit: Moved to the Development and Programming forum]

       
Tom Jaeger's avatar
Tom Jaeger
497 posts
14 years ago
Tom Jaeger's avatar Tom Jaeger

Are you running Freebie by chance? I’ve run into this while working on sites with freebie installed. If this is the case, I have a work around I can share as well.

       
Chad Crowell's avatar
Chad Crowell
242 posts
14 years ago
Chad Crowell's avatar Chad Crowell

Hi Tom - ya Freebie is on this site that Carl and I are working on together. However “ignore numeric segments” is not enabled, so it shouldn’t be effecting his 345 segment. Have you seen different?

       
Tom Jaeger's avatar
Tom Jaeger
497 posts
14 years ago
Tom Jaeger's avatar Tom Jaeger

I’ve seen a few interesting behaviors like this, but not this one specifically.

If you dump

$this->EE->config->_global_vars

Do you see it in there as a ‘freebie_#’ array element?

       
Chad Crowell's avatar
Chad Crowell
242 posts
14 years ago
Chad Crowell's avatar Chad Crowell

I think I’ve fixed it by setting the ignore numerics to yes, save, then no, save. I’ll let Carl verify that.

       
Tom Jaeger's avatar
Tom Jaeger
497 posts
14 years ago
Tom Jaeger's avatar Tom Jaeger

Sweet, that’s a good one to keep in mind.

       
Carl W Crawley's avatar
Carl W Crawley
136 posts
14 years ago
Carl W Crawley's avatar Carl W Crawley

Yep - that worked Tom… Interesting though

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.