Skip to content
Browse files

Fix bug #800 ("Object" is output prior to the HTML ouput if doctype i…

…s unknown)

* add HTML 4.0 to doctypes


git-svn-id: http://svn.php.net/repository/pear/packages/HTML_Page/trunk@152355 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent f58396e commit a48ae2874be06d1f1df8884b666948f317a5dde7 Klaus Guenther committed Feb 25, 2004
Showing with 14 additions and 2 deletions.
  1. +2 −2 Page.php
  2. +12 −0 Page/Doctypes.php
View
4 Page.php
@@ -608,8 +608,9 @@ function _getDoctype()
if ($strDoctype) {
return $strDoctype;
} else {
- return PEAR::raiseError('Error: "'.$this->getDoctypeString().'" is an unsupported or illegal document type.',
+ PEAR::raiseError('Error: "'.$this->getDoctypeString().'" is an unsupported or illegal document type.',
0,PEAR_ERROR_TRIGGER);
+ $this->_simple = true;
}
} // end func _getDoctype
@@ -1061,7 +1062,6 @@ function toHTML()
// get the doctype declaration
$strDoctype = $this->_getDoctype();
-echo "ok<br>\n";
// This determines how the doctype is declared
if ($this->_simple) {
View
12 Page/Doctypes.php
@@ -81,6 +81,18 @@
$doctype['html']['4.01']['frameset'][] = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"';
$doctype['html']['4.01']['frameset'][] = ' "http://www.w3.org/TR/html4/frameset.dtd">';
+// HTML 4.0 Strict
+$doctype['html']['4.0']['strict'][] = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"';
+$doctype['html']['4.0']['strict'][] = ' "http://www.w3.org/TR/REC-html40/strict.dtd">';
+
+// HTML 4.0 Transitional
+$doctype['html']['4.0']['transitional'][] = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"';
+$doctype['html']['4.0']['transitional'][] = ' "http://www.w3.org/TR/REC-html40/loose.dtd">';
+
+// HTML 4.0 Frameset
+$doctype['html']['4.0']['frameset'][] = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN"';
+$doctype['html']['4.0']['frameset'][] = ' "http://www.w3.org/TR/REC-html40/frameset.dtd">';
+
// Since the following is simply historic, I'm not adding the level 1 & 2 or strict stuff.
// This doctype should be sufficient for most historic uses.

0 comments on commit a48ae28

Please sign in to comment.
Something went wrong with that request. Please try again.