WordPress.org

Make WordPress Core

Ticket #14069: robots.patch

File robots.patch, 823 bytes (added by joostdevalk, 8 years ago)

Patch 2nd go

  • wp-includes/functions.php

     
    18001800 * @uses do_action() Calls 'do_robotstxt' hook for displaying robot.txt rules.
    18011801 */
    18021802function do_robots() {
    1803         header( 'Content-Type: text/plain; charset=utf-8' );
     1803        header( 'Content-Type: text/plain; charset=US-ASCII' );
    18041804
    18051805        do_action( 'do_robotstxt' );
    1806 
    1807         $output = '';
     1806        $output = "User-agent: *\n";
    18081807        $public = get_option( 'blog_public' );
    1809         if ( '0' ==  $public ) {
    1810                 $output .= "User-agent: *\n";
     1808
     1809        if ( '0' ==  $public )
    18111810                $output .= "Disallow: /\n";
    1812         } else {
    1813                 $output .= "User-agent: *\n";
     1811        else
    18141812                $output .= "Disallow:\n";
    1815         }
    18161813
    18171814        echo apply_filters('robots_txt', $output, $public);
    18181815}