Browse files

Fix duplicated webroot path on HtmlHelper::meta('icon').

  • Loading branch information...
1 parent df52e85 commit 4677ddf49098fa533ade32edf96e9525b2bc9400 @mathop mathop committed Nov 19, 2013
Showing with 9 additions and 1 deletion.
  1. +8 −0 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
  2. +1 −1 lib/Cake/View/Helper/HtmlHelper.php
View
8 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
@@ -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);
}
/**
View
2 lib/Cake/View/Helper/HtmlHelper.php
@@ -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])) {

0 comments on commit 4677ddf

Please sign in to comment.