Skip to content

Commit

Permalink
Version Detection
Browse files Browse the repository at this point in the history
  • Loading branch information
glydetech committed Jun 8, 2011
1 parent 900f963 commit 7749cba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions classes/head.php
Expand Up @@ -323,7 +323,13 @@ private function _get_meta_extra()
$includes = Kohana::config('xhtml.meta_include_headers');
if ($includes)
{
foreach (Request::current()->headers as $key => $value)
if (substr(Kohana::VERSION, 0, 3) == '3.0')
{
$request = Request::instance();
} else {
$request = Request::current();
}
foreach ($request->headers as $key => $value)
{
if (in_array(strtolower($key), $includes))
{
Expand Down Expand Up @@ -392,4 +398,4 @@ private function _get_merged_styles()
}
return $html;
}
} // End Head
} // End Head
10 changes: 8 additions & 2 deletions classes/xhtml.php
Expand Up @@ -216,7 +216,13 @@ public function render($output = false)
{
// Set content-type header
//Header('Content-Type: '.$this->contenttype.';; charset='.$this->charset);
Request::current()->headers['Content-Type'] = $this->contenttype.'; charset='.$this->charset;
if (substr(Kohana::VERSION, 0, 3) == '3.0')
{
$request = Request::instance();
} else {
$request = Request::current();
}
$request->headers['Content-Type'] = $this->contenttype.'; charset='.$this->charset;
$html = $this->xhtml_doctype;
$html .= '<html'.Html::attributes($this->htmlatts_all).'>';
$html .= Head::instance();
Expand Down Expand Up @@ -337,4 +343,4 @@ private function _get_contenttype()
return 'text/html';
}

} // End Xhtml
} // End Xhtml

0 comments on commit 7749cba

Please sign in to comment.