mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
fixes #4986, .ctp extension failover for layouts
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7260 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
c60b232ab4
commit
abf3d0685a
2 changed files with 8 additions and 1 deletions
|
@ -828,7 +828,7 @@ class View extends Object {
|
|||
foreach ($paths as $path) {
|
||||
if (file_exists($path . $file . $this->ext)) {
|
||||
return $path . $file . $this->ext;
|
||||
} elseif (file_exists($path . $name . '.ctp')) {
|
||||
} elseif (file_exists($path . $file . '.ctp')) {
|
||||
return $path . $file . '.ctp';
|
||||
} elseif (file_exists($path . $file . '.thtml')) {
|
||||
return $path . $file . '.thtml';
|
||||
|
|
|
@ -656,6 +656,13 @@ class ViewTest extends CakeTestCase {
|
|||
|
||||
$this->assertPattern("/<em>PostsController::<\/em><em>something\(\)<\/em>/", $result);
|
||||
$this->assertPattern("/posts(\/|\\\)this_is_missing.whatever/", $result);
|
||||
|
||||
$this->PostsController->ext = ".bad";
|
||||
$View = new TestView($this->PostsController);
|
||||
$result = str_replace(array("\t", "\r\n", "\n"), "", $View->render('index'));
|
||||
|
||||
$this->assertPattern("/<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/><title>/", $result);
|
||||
$this->assertPattern("/<div id=\"content\">posts index<\/div>/", $result);
|
||||
}
|
||||
/**
|
||||
* tearDown method
|
||||
|
|
Loading…
Reference in a new issue