6.0.0-git
2018-12-15

[#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 2008-11-27 (3670 days ago)
Due
Updated 2010-09-24 (3004 days ago)
Assigned 2008-11-27 (3670 days ago)
Resolved
Milestone
Patch No

History
2010-09-24 22:22:07 Jan Schneider Version ⇒ Git master
 
2008-11-29 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'));
2008-11-27 17:16:46 Chuck Hagenbuch Assigned to Chuck Hagenbuch
 
2008-11-27 16:02:38 Chuck Hagenbuch Summary ⇒ Routes: Underscore between vars in URL
 
2008-11-27 16:02:24 Chuck Hagenbuch Version ⇒ HEAD
 
2008-11-27 11:40:47 Jan Schneider Assigned to Mike Naberezny
State ⇒ Assigned
 
2008-11-27 11:38:10 Jan Schneider Priority ⇒ 2. Medium
 
2008-11-27 10:52:44 edleadesign (at) gmail (dot) com Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 3. High
Summary ⇒ Routes: Undersocre between vars in URL
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
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