6.0.0-beta13
4/10/26

[#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/08 (6343 days ago)
Due
Updated 9/24/10 (5677 days ago)
Assigned 11/27/08 (6343 days ago)
Resolved
Github Issue Link
Github Pull Request
Milestone
Patch No

History
24.09.2010 22:22:07 Jan Schneider Version ⇒ Git master
 
29.11.2008 01:17:02 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'));
27.11.2008 17:16:46 Chuck Hagenbuch Assigned to Chuck Hagenbuch
 
27.11.2008 16:02:38 Chuck Hagenbuch Summary ⇒ Routes: Underscore between vars in URL
 
27.11.2008 16:02:24 Chuck Hagenbuch Version ⇒ HEAD
 
27.11.2008 11:40:47 Jan Schneider State ⇒ Assigned
Assigned to Mike Naberezny
 
27.11.2008 11:38:10 Jan Schneider Priority ⇒ 2. Medium
 
27.11.2008 10:52:44 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