Wednesday, August 5, 2009

Re: Slug name limitations

But still... if a user chooses admin for slug, it would cause quite a bit of trouble...

My guess is the only way to avoid this is to either hardcode an array of reserved words and keep changing it as you add controllers-actions, or simply do what u mentioned in first post about querying the ACOS table... maybe that + reserverd words would be the best solution

2009/8/5 Jamie <jamie.nay@gmail.com>

Well, it all depends on the order of your Router rules in routes.php.
If you put the rule to interpret /admin as going to your admin area
BEFORE the rule to process those generic slugs, then you won't have a
problem. Generally, you want to put those catch-all router rules at or
near the end of routes.php, after any specific router rules.

On Aug 4, 8:18 pm, "Dave Maharaj :: WidePixels.com"
<d...@widepixels.com> wrote:
> I have for example
>
> Site/slug => which goes to controller users, action view
>
> Or site/slug/profile => which goes to controller users, action profile
>
> So if someone used "admin" for example
>
> It would go to site/admin which obviously would get them nowhere.
>
> I put my slug in front of the controller/action
>
> -----Original Message-----
> From: JamesF [mailto:usaexportexpe...@gmail.com]
> Sent: August-05-09 12:21 AM
> To: CakePHP
> Subject: Re: Slug name limitations
>
> im not sure i understand why a slug should conflict with you functions.
> /posts/index/id-slug should be ok.
> can you explain a little more?
>
> On Aug 4, 8:49 am, "Dave Maharaj :: WidePixels.com"
> <d...@widepixels.com> wrote:
> > How would you validate a user created slug so that it is not a name
> > used as a function in the app? (in my app they choose the slug they
> > want...not created by first + lastname)
>
> > I obviuosly do not want a user choosing a slug "admin" or any
> > controller name || function?
> > Since all of these are stored in the ACOS table is it best to query
> > the table against what the user submits?
>
> > Dave



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: