Issue Bug Closed

#15617template->docType is not compatible with IE

old_hkdennis2k 02/13/06, 11:39 updated 10/02/18, 12:33

Description

If you set
$SOBE->doc->docType=‘xhtml_trans’;
IE may ignore Content-Type setting and using XML parser open the page.

I am using UTF-8 in typo3.
When php print unicode BOM and some empty lines at the beginning.
I think these clause by include() / include_once()

—- begin —-
C:\Perl\bin>get -axS -H “User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.1; SV1)” http://127.0.0.1/typo3/ |more
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://127.0.0.1/typo3/
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
Parsing of undecoded UTF-8 will give garbage when decoding entities at C:/Perl/s
ite/lib/LWP/Protocol.pm line 114.
LWP::Protocol::collect: read 243 bytes
LWP::UserAgent::request: Simple response: OK
GET http://127.0.0.1/typo3/ —> 200 OK


g/TR/xhtml1/DTD/xhtml1-transitional.dtd"><?xml version="1.0" encoding="utf-8"?>
?xml-stylesheet href="#internalStyle" type="text/css"?>
<html><br>—- end —-</html>

IE will ignore Content-Type and always using XML mode to read the content.
(and it is not a vaild xml becsuse <html></html>

Software version
typo3 3.8.1
IE 6.0.2900.2180
apache 2.0.55
PHP 5.0.5 (cli) (built: Sep 5 2005 15:54:44) with eAccelerator v0.9.3-rc2

Solution

add @ob_clean(); at the beginng of template-startPage()

typo3/template.php

function startPage($title)    {
+
+ @ob_clean(); // FIX IE bug~!!!
+
// Get META tag containing the currently selected charset for backend output. The function sets $this->charSet.
$charSet = $this->initCharset();
$generator = $this->generator();

(issue imported from #M2549)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.