Make WordPress Core

Ticket #32864: 32864.patch

File 32864.patch, 1.0 KB (added by kraftbj, 11 years ago)
  • src/wp-admin/includes/class-wp-press-this.php

     
    11681168        }
    11691169
    11701170        /**
     1171         * Sets the user agent used for Press This HTTP requests.
     1172         *
     1173         * @since 4.3.0
     1174         * @access public
     1175         *
     1176         * @global string $wp_version
     1177         *
     1178         * @return string User agent.
     1179         */
     1180        public function ua_string() {
     1181                global $wp_version;
     1182
     1183                $user_agent = 'Press This (WordPress/' . $wp_version . '); ' . get_bloginfo( 'url' );
     1184
     1185                return $user_agent;
     1186        }
     1187
     1188        /**
    11711189         * Serves the app's base HTML, which in turns calls the load script.
    11721190         *
    11731191         * @since 4.2.0
     
    11801198        public function html() {
    11811199                global $wp_locale, $wp_version;
    11821200
     1201                // Set explicit user-agent for the $data outbound HTTP requests.
     1202                add_filter( 'http_headers_useragent', array( $this, 'ua_string' ) );
     1203
    11831204                // Get data, new (POST) and old (GET).
    11841205                $data = $this->merge_or_fetch_data();
    11851206