diff --git a/src/Routing/Route/Route.php b/src/Routing/Route/Route.php index 3f584fd013e..768538a491d 100644 --- a/src/Routing/Route/Route.php +++ b/src/Routing/Route/Route.php @@ -150,7 +150,7 @@ public function compiled() { * @return array Returns a string regular expression of the compiled route. */ public function compile() { - if ($this->compiled()) { + if (!empty($this->compiledRoute)) { return $this->_compiledRoute; } $this->_writeRoute(); @@ -259,7 +259,7 @@ public function getName() { public function parse($url) { $request = Router::getRequest(true) ?: Request::createFromGlobals(); - if (!$this->compiled()) { + if (empty($this->_compiledRoute)) { $this->compile(); } list($url, $ext) = $this->_parseExtension($url); @@ -399,7 +399,7 @@ protected function _parseArgs($args, $context) { * @return mixed Either a string url for the parameters if they match or false. */ public function match(array $url, array $context = []) { - if (!$this->compiled()) { + if (empty($this->_compiledRoute)) { $this->compile(); } $defaults = $this->defaults;