--- wp-blog-header.php.orig Sun Mar 20 15:55:36 2005
+++ wp-blog-header.php Sun Mar 20 21:49:36 2005
@@ -115,7 +115,18 @@
@header('HTTP/1.x 404 Not Found');
} else if ( empty($feed) ) {
@header('X-Pingback: '. get_bloginfo('pingback_url'));
- @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
+ if ( (preg_match("/Gecko|W3C_Validator|MathPlayer/",
+ $_SERVER["HTTP_USER_AGENT"])
+ && !preg_match("/Chimera|Camino|KHTML/",
+ $_SERVER["HTTP_USER_AGENT"]))
+ || preg_match("/Camino.*MathML-Enabled/",
+ $_SERVER["HTTP_USER_AGENT"]) ) {
+ @header('Content-type: application/xhtml+xml; charset='
+ . get_option('blog_charset'));
+ } else {
+ @header('Content-type: text/html; charset='
+ . get_option('blog_charset'));
+ }
} else {
// We're showing a feed, so WP is indeed the only thing that last changed
if ( $withcomments )
--- wp-includes/functions-formatting.php.orig Mon Feb 14 18:21:21 2005
+++ wp-includes/functions-formatting.php Sun Mar 20 23:18:20 2005
@@ -40,7 +40,7 @@
} else {
$next = true;
}
- $curl = preg_replace('/&([^#])(?![a-z12]{1,8};)/', '&$1', $curl);
+ $curl = preg_replace('/&([^#])(?![a-z12]+;)/i', '&$1', $curl);
$output .= $curl;
}
return $output;
@@ -57,20 +57,20 @@
$pee = $pee . "\n"; // just to make things a little easier, pad the end
$pee = preg_replace('|
\s*
|', "\n\n", $pee);
// Space things out a little
- $pee = preg_replace('!(<(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|math|p|h[1-6])[^>]*>)!', "\n$1", $pee);
- $pee = preg_replace('!((?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|math|p|h[1-6])>)!', "$1\n", $pee);
+ $pee = preg_replace('!(<(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)!', "\n$1", $pee);
+ $pee = preg_replace('!((?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])>)!', "$1\n", $pee);
$pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
$pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates
$pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "\t
$1
\n", $pee); // make paragraphs, including one at the end $pee = preg_replace('|\s*?
|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace - $pee = preg_replace('!\s*(?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|math|p|h[1-6])[^>]*>)\s*
!', "$1", $pee); // don't pee all over a tag + $pee = preg_replace('!\s*(?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|p|h[1-6])[^>]*>)\s*
!', "$1", $pee); // don't pee all over a tag $pee = preg_replace("|(
]*)>|i', "', $pee); - $pee = preg_replace('!', '", $pee); $pee = str_replace('
\s*(?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|math|p|h[1-6])[^>]*>)!', "$1", $pee); - $pee = preg_replace('!(?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|math|p|h[1-6])[^>]*>)\s*
!', "$1", $pee); + $pee = preg_replace('!\s*(?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|p|h[1-6])[^>]*>)!', "$1", $pee); + $pee = preg_replace('!(?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)\s*
!', "$1", $pee); if ($br) $pee = preg_replace('|(?)\s*\n|', "/i',$line)){$pre = true; } + if(preg_match('/","\n",$line); } - if(preg_match('/<\/pre>/i',$line)){$pre = false; } + if(preg_match('/<\/pre>/i',$line)){$pre = false;} + if(preg_match('/<\/math>/i',$line)){$math = false;} if ($list == '' && preg_match('/^\t\t