Ok sorry. Here's a more full explanation:

In my index.ctp I have links that look like this: <?php echo $this-
>Html->link($post['Post']['title'], array('controller' => 'posts',
'action' => 'view', $post['Post']['id'],Inflector::slug($post['Post']
['title'], '-'))); ?>

Then in the PostsController view() method, this is what it looks like:

function view($id = null) {
                if (!$id) {
                        $this->Session->setFlash(__('Invalid post', true));
                        $this->redirect(array('action' => 'index'));
                }

                $post = $this->set('post', $this->Post->read(null, $id));
                $this->theme = 'jonlyles';

              if(Inflector::slug($post['Post']['title']) != $this-
>params['pass'][1] || count($this->params['pass']) != 2 ) {
$post = $this->Post->read(null, $id);
              $this->redirect(array($id, Inflector::slug($post['Post']
['title']), 301));
               }
        }


If I remove the last if condition there are no errors, but then no
protection against bad urls either.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to