Skip to content

Commit

Permalink
Fix duplicated webroot path on HtmlHelper::meta('icon').
Browse files Browse the repository at this point in the history
  • Loading branch information
mathop committed Nov 19, 2013
1 parent df52e85 commit 4677ddf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
Expand Up @@ -1757,6 +1757,14 @@ public function testMetaIcon() {
)
);
$this->assertTags($result, $expected);

$this->Html->request->webroot = '/testing/';
$result = $this->Html->meta('icon');
$expected = array(
'link' => array('href' => '/testing/favicon.ico', 'type' => 'image/x-icon', 'rel' => 'icon'),
array('link' => array('href' => '/testing/favicon.ico', 'type' => 'image/x-icon', 'rel' => 'shortcut icon'))
);
$this->assertTags($result, $expected);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/HtmlHelper.php
Expand Up @@ -253,7 +253,7 @@ public function meta($type, $url = null, $options = array()) {
);

if ($type === 'icon' && $url === null) {
$types['icon']['link'] = $this->webroot('favicon.ico');
$types['icon']['link'] = 'favicon.ico';
}

if (isset($types[$type])) {
Expand Down

0 comments on commit 4677ddf

Please sign in to comment.