diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php
index 4c13bd301..2d460b2af 100644
--- a/cake/libs/view/helpers/html.php
+++ b/cake/libs/view/helpers/html.php
@@ -226,14 +226,15 @@ class HtmlHelper extends AppHelper {
$attributes = array_merge($type, $attributes);
- if (isset($attributes['link'])) {
+ $out = null;
+ if (isset($attributes['link'])) {
if (isset($attributes['rel']) && $attributes['rel'] === 'icon') {
+ $out = sprintf($this->tags['metalink'], $attributes['link'], $this->_parseAttributes($attributes, array('link')));
$attributes['rel'] = 'shortcut icon';
- $out .= sprintf($this->tags['metalink'], $attributes['link'], $this->_parseAttributes($attributes, array('link')));
} else {
$attributes['link'] = $this->url($attributes['link'], true);
}
- $out = sprintf($this->tags['metalink'], $attributes['link'], $this->_parseAttributes($attributes, array('link')));
+ $out .= sprintf($this->tags['metalink'], $attributes['link'], $this->_parseAttributes($attributes, array('link')));
} else {
$out = sprintf($this->tags['meta'], $this->_parseAttributes($attributes, array('type')));
}
diff --git a/cake/tests/cases/libs/view/helper.test.php b/cake/tests/cases/libs/view/helper.test.php
index eb61b0094..8e468abed 100755
--- a/cake/tests/cases/libs/view/helper.test.php
+++ b/cake/tests/cases/libs/view/helper.test.php
@@ -102,6 +102,7 @@ class HelperTestPostsTag extends Model {
class HelperTest extends UnitTestCase {
function setUp() {
+ ClassRegistry::flush();
Router::reload();
$null = null;
$this->View = new View($null);