Make WordPress Core

Ticket #1093: xhtml_negotiation.patch

File xhtml_negotiation.patch, 5.7 KB (added by idanso, 19 years ago)
  • wp-blog-header.php

    ==== Patch <xhtml_negotiation> level 2
    Source: 81e510b7-0ff2-0310-ae0c-f70243c84fd4:/wordpress-idansof_xhtml_mime:2442 [local]
    Target: 1a063a9b-81f0-0310-95a4-ce76da25c4cd:/trunk:2434 [mirrored]
            (http://svn.automattic.com/wordpress/trunk)
    Log:
     r2440@tuxbox:  idan | 2005-03-12 22:12:18 +0200
     Branch xhtml-mime feature
     r2441@tuxbox:  idan | 2005-03-12 23:39:28 +0200
     Deprecate html_type option - use XHTML content negotiation
     r2442@tuxbox:  idan | 2005-03-12 23:58:03 +0200
     Add use_xhtml_mime option to upgrade-schema
    
    === wp-blog-header.php
    ==================================================================
     
    115115                @header('HTTP/1.x 404 Not Found');
    116116 } else if ( empty($feed) ) {
    117117        @header('X-Pingback: '. get_bloginfo('pingback_url'));
    118         @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
     118        @header('Content-type: ' . get_bloginfo('html_type') . '; charset=' . get_option('blog_charset'));
    119119} else {
    120120        // We're showing a feed, so WP is indeed the only thing that last changed
    121121        if ( $withcomments )
  • wp-includes/template-functions-general.php

    === wp-includes/template-functions-general.php
    ==================================================================
     
    113113                if ('' == $output) $output = 'UTF-8';
    114114                break;
    115115        case 'html_type' :
    116                 $output = get_option('html_type');
     116                if(get_settings('use_xhtml_mime') && substr_count($_SERVER['HTTP_ACCEPT'],'application/xhtml+xml')>0)
     117                  $output = "application/xhtml+xml";
     118                else
     119                  $output = "text/html";
    117120                break;
    118121        case 'version':
    119122                global $wp_version;
  • wp-admin/admin-header.php

    === wp-admin/admin-header.php
    ==================================================================
     
    11<?php
    2 @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
     2@header('Content-type: ' . get_bloginfo('html_type') . '; charset=' . get_option('blog_charset'));
    33if (!isset($_GET["page"])) require_once('admin.php'); ?>
    44<?php get_admin_page_title(); ?>
    55<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  • wp-admin/options-reading.php

    === wp-admin/options-reading.php
    ==================================================================
     
    1111<h2><?php _e('Reading Options') ?></h2>
    1212<form name="form1" method="post" action="options.php">
    1313        <input type="hidden" name="action" value="update" />
    14         <input type="hidden" name="page_options" value="'posts_per_page','what_to_show','posts_per_rss','rss_use_excerpt','blog_charset','gzipcompression' " />
     14        <input type="hidden" name="page_options" value="'posts_per_page','what_to_show','posts_per_rss','rss_use_excerpt','blog_charset','gzipcompression','use_xhtml_mime' " />
    1515        <fieldset class="options">
    1616        <legend><?php _e('Blog Pages') ?></legend>
    1717        <table width="100%" cellspacing="2" cellpadding="5" class="editform">
     
    5151                <?php _e('The character encoding you write your blog in (UTF-8 is <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td>
    5252                </tr>
    5353        </table>
    54         <p>
     54        <div>
    5555                <label><input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> />
    5656                 <?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label>
    57         </p>
     57        </div>
     58        <div>
     59                <label><input type="checkbox" name="use_xhtml_mime" value="1" <?php checked('1', get_settings('use_xhtml_mime')); ?> />
     60                 <?php _e('WordPress should deliver content in as application/xhtml+xml for supporting browsers') ?></label>
     61        </div>
    5862        <p class="submit">
    5963                <input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
    6064        </p>
    6165</form>
    6266</div>
    63 <?php include('./admin-footer.php'); ?>
    64  No newline at end of file
     67<?php include('./admin-footer.php'); ?>
  • wp-admin/upgrade-schema.php

    === wp-admin/upgrade-schema.php
    ==================================================================
     
    214214        add_option('comment_registration', 0);
    215215        add_option('open_proxy_check', 1);
    216216        add_option('rss_language', 'en');
    217         add_option('html_type', 'text/html');
     217        // 1.5.1
     218        add_option('use_xhtml_mime', 0);
    218219
    219220        // Delete unused options
    220221        $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url');