diff --git a/cake/libs/dispatcher.php b/cake/libs/dispatcher.php index cb14d18ba82..4f35138c8ae 100644 --- a/cake/libs/dispatcher.php +++ b/cake/libs/dispatcher.php @@ -315,7 +315,8 @@ public function asset($url) { $this->_stop(); } $controller = null; - $ext = array_pop(explode('.', $url)); + $pathSegments = explode('.', $url); + $ext = array_pop($pathSegments); $parts = explode('/', $url); $assetFile = null; diff --git a/cake/libs/file.php b/cake/libs/file.php index 0151181f532..47f922d9d4e 100644 --- a/cake/libs/file.php +++ b/cake/libs/file.php @@ -212,7 +212,7 @@ public function offset($offset = false, $seek = SEEK_SET) { * @param string $data Data to prepare for writing. * @return string The with converted line endings. */ - public function prepare($data, $forceWindows = false) { + public static function prepare($data, $forceWindows = false) { $lineBreak = "\n"; if (DIRECTORY_SEPARATOR == '\\' || $forceWindows === true) { $lineBreak = "\r\n"; diff --git a/cake/tests/cases/libs/dispatcher.test.php b/cake/tests/cases/libs/dispatcher.test.php index 35f161e7a7f..0192e6740e2 100644 --- a/cake/tests/cases/libs/dispatcher.test.php +++ b/cake/tests/cases/libs/dispatcher.test.php @@ -49,12 +49,11 @@ class TestDispatcher extends Dispatcher { * invoke method * * @param mixed $controller - * @param mixed $params - * @param mixed $missingAction + * @param mixed $request * @return void */ - protected function _invoke(&$controller, $params) { - if ($result = parent::_invoke($controller, $params)) { + protected function _invoke(Controller $controller, CakeRequest $request) { + if ($result = parent::_invoke($controller, $request)) { if ($result[0] === 'missingAction') { return $result; } @@ -192,7 +191,7 @@ protected function _protected() { * * @return void */ - public function redirect() { + public function redirect($url, $status = null, $exit = true) { echo 'this should not be accessible'; } } diff --git a/cake/tests/cases/libs/folder.test.php b/cake/tests/cases/libs/folder.test.php index 4285206107e..472385243ff 100644 --- a/cake/tests/cases/libs/folder.test.php +++ b/cake/tests/cases/libs/folder.test.php @@ -195,8 +195,8 @@ function testOperations() { $this->assertFalse($result); $expected = $new . ' is a file'; - $result = array_pop($Folder->errors()); - $this->assertEqual($result, $expected); + $result = $Folder->errors(); + $this->assertEqual($result[0], $expected); $new = TMP . 'test_folder_new'; $result = $Folder->create($new); diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 92c3f0971d1..ffe168ac8f7 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -2273,7 +2273,7 @@ public function testUrlProtocol() { * @return void */ function testPatternOnAction() { - $route =& new CakeRoute( + $route = new CakeRoute( '/blog/:action/*', array('controller' => 'blog_posts'), array('action' => 'other|actions')