Page 1 of 1

preg_match unknown modifier

Posted: Fri Sep 17, 2010 9:04 pm
by nottledim
I'm using v 1.82 and trying to get pretty URLs to work.  I persistently get
Warning: preg_match() [function.preg-match]: Unknown modifier '\' in /var/www-apps/newru/lib/page.functions.php on line 1336

The patterns come from an array of patterns called routes from $gCMS and they look like this:

/(?P[a-z-\/_0-9]+)\/album-(?P[0-9]+)\/(?P[0-9]+)\/(?P[0-9]+)$/
/(?P[a-z-\/_0-9]+)\/album-(?P[0-9]+)\/(?P[0-9]+)$/
/(?P[a-z-\/_0-9]+)\/album-(?P[0-9]+)\/page(?P[0-9]+)\/(?P[0-9]+)$/
/[bB]logs\/(?P[0-9]+)\/(?P[0-9]+)$/
/[bB]logs\/(?P[0-9]+)\/(?P[0-9]+)$/
/[bB]logs\/(?P[0-9]+)\/(?P[0-9]+)\/(?P[0-9]+)$/
[fF]eu\/verify\/(?P[0-9]+)\/(?P[0-9]+)\/(?P.*?)$/

The last one here causes the error because, as you can see, it doesn't have a starting /.

I'm stuck now, I don't really know what I'm looking at - where do I look for the root cause of this error?

Thanks

Re: preg_match unknown modifier

Posted: Fri Sep 17, 2010 9:44 pm
by nottledim
I think I've found the problem - a bug I think:

line 253 in  FrontEndUsers.module.php

    $this->RegisterRoute('[fF]eu\/verify\/(?P[0-9]+)\/(?P[0-9]+)\/(?P.*?)$/',
                        array('action'=>'verifycode'));

should be

    $this->RegisterRoute('/[fF]eu\/verify\/(?P[0-9]+)\/(?P[0-9]+)\/(?P.*?)$/',
                        array('action'=>'verifycode'));