← Back to team overview

anewt-developers team mailing list archive

[Branch ~uws/anewt/anewt.uws] Rev 1777: [urldispatcher] Actually use global constraints

 

------------------------------------------------------------
revno: 1777
committer: Wouter Bolsterlee <uws@xxxxxxxxx>
branch nick: anewt.uws
timestamp: Fri 2010-03-26 22:38:30 +0100
message:
  [urldispatcher] Actually use global constraints
  
  Oops, the constraints that are supposed to be used for all
  routes were completely ignored, which means that any value
  would match... :s
modified:
  urldispatcher/urldispatcher.lib.php


--
lp:anewt
https://code.launchpad.net/~uws/anewt/anewt.uws

Your team Anewt developers is subscribed to branch lp:anewt.
To unsubscribe from this branch go to https://code.launchpad.net/~uws/anewt/anewt.uws/+edit-subscription.
=== modified file 'urldispatcher/urldispatcher.lib.php'
--- urldispatcher/urldispatcher.lib.php	2010-02-20 15:29:38 +0000
+++ urldispatcher/urldispatcher.lib.php	2010-03-26 21:38:30 +0000
@@ -224,13 +224,6 @@
 	private $routes = array();
 
 	/**
-	 * Constraints for URL parts.
-	 *
-	 * This only applies to routes added using add_route_url_parts().
-	 */
-	private $url_part_constraints = array();
-
-	/**
 	 * Construct a new AnewtURLDispatcher instance.
 	 *
 	 * Make sure you call this method from derived classes!
@@ -238,6 +231,7 @@
 	public function __construct()
 	{
 		$this->_seed(array(
+			'constraints'            => array(),
 
 			'force-trailing-slash'   => true,
 
@@ -683,7 +677,7 @@
 				if (count($url_parts) != count($route_url_parts))
 					continue;
 
-				$constraints = array_merge($this->url_part_constraints, $additional_constraints);
+				$constraints = array_merge($this->constraints, $additional_constraints);
 
 				for ($i = 0; $i < count($url_parts); $i++)
 				{