[FEATURE] Added support for domain regex matching.

- Also improved regex matching when using custom regular expressions.
This commit is contained in:
Simon Sessingø
2015-12-10 01:34:35 +01:00
parent b1768d86f7
commit 2128a24f1c
+2 -2
View File
@@ -26,14 +26,14 @@ class RouterRoute extends RouterEntry {
// Match on custom defined regular expression
if($this->regexMatch) {
$parameters = array();
if(preg_match('/('.$this->regexMatch.')/is', $url, $parameters)) {
if(preg_match('/('.$this->regexMatch.')/is', request()->getHost() . $url, $parameters)) {
$this->parameters = (!is_array($parameters[0]) ? array($parameters[0]) : $parameters[0]);
return $this;
}
return null;
}
// Make regular expression based on route
$route = rtrim($this->url, '/') . '/';
$parameterNames = array();