From 12466ebe432443f4ffb9f8996260ba46a55c31c8 Mon Sep 17 00:00:00 2001 From: nate Date: Mon, 3 Mar 2008 23:56:18 +0000 Subject: [PATCH] Making sure default extension is always set when Router::parseExtensions() is used git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6507 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/router.php | 3 +++ cake/tests/cases/libs/router.test.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 3232bf349..a38920f0d 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -502,6 +502,9 @@ class Router extends Object { } } } + if (empty($ext)) { + $ext = 'html'; + } } return compact('ext', 'url'); } diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index e6b207d81..5214608c5 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -766,7 +766,7 @@ class RouterTest extends UnitTestCase { $this->assertEqual($result, $expected); $result = $this->router->parse('/posts.atom?hello=goodbye'); - $expected = array('plugin' => null, 'controller' => 'posts.atom', 'action' => 'index', 'pass' => array(), 'named' => array()); + $expected = array('plugin' => null, 'controller' => 'posts.atom', 'action' => 'index', 'pass' => array(), 'named' => array(), 'url' => array('ext' => 'html')); $this->assertEqual($result, $expected); $this->router->reload();