6.0.0-alpha10
5/14/25

[#7727] Routes: Underscore between vars in URL
Summary Routes: Underscore between vars in URL
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Assigned
Priority 2. Medium
Owners mike (at) naberezny (dot) com
Requester edleadesign (at) gmail (dot) com
Created 11/27/2008 (6012 days ago)
Due
Updated 09/24/2010 (5346 days ago)
Assigned 11/27/2008 (6012 days ago)
Resolved
Milestone
Patch No

History
09/24/2010 10:22:07 PM Jan Schneider Version ⇒ Git master
 
11/29/2008 01:17:02 AM Chuck Hagenbuch Comment #2
Taken from Chuck Hagenbuch
Reply to this comment
I've verified that essentially the same regex error happens in the 
python version given the same input. I think the route might simply be 
ambiguous; if you use this as the route path, it works:



$m->connect('/some/example/:(myVar)_:(anotherVar)', array('controller' 
=> 'default'));
11/27/2008 05:16:46 PM Chuck Hagenbuch Assigned to Chuck Hagenbuch
 
11/27/2008 04:02:38 PM Chuck Hagenbuch Summary ⇒ Routes: Underscore between vars in URL
 
11/27/2008 04:02:24 PM Chuck Hagenbuch Version ⇒ HEAD
 
11/27/2008 11:40:47 AM Jan Schneider State ⇒ Assigned
Assigned to Mike Naberezny
 
11/27/2008 11:38:10 AM Jan Schneider Priority ⇒ 2. Medium
 
11/27/2008 10:52:44 AM edleadesign (at) gmail (dot) com Comment #1
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ Routes: Undersocre between vars in URL
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
when creating a route with an "_" between to variables like this:



/some/example/:myVar_:anotherVar



I get the following error



  MESSAGE: preg_match() [function.preg-match]: Compilation failed: 
syntax error in subpattern name (missing terminator) at offset 42

TYPE: Warning

FILE: /usr/local/php5/lib/php/Horde/Routes/Route.php

LINE: 612

DEBUG INFO:



607 if (substr($url, -1) == '/' && strlen($url) > 1) {

608 $url = substr($url, 0, -1);

609 }

610

611 // Match the regexps we generated

612 $match = preg_match('@' . str_replace('@', '\@', $this->regexp) . 
'@', $url, $matches);



613 if ($match == 0) {

614 return false;

615 }

616

617 $host = isset($kargs['environ']['HTTP_HOST']) ? 
$kargs['environ']['HTTP_HOST'] : null;

Saved Queries