Make WordPress Core

Ticket #39653: 39653.patch

File 39653.patch, 3.4 KB (added by sebastian.pisula, 8 years ago)
  • wp-includes/class-http.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    727727
    728728                        $cookies_header = '';
    729729                        foreach ( (array) $r['cookies'] as $cookie ) {
    730                                 $cookies_header .= $cookie->getHeaderValue() . '; ';
     730                                $cookies_header .= $cookie->get_header_value() . '; ';
    731731                        }
    732732
    733733                        $cookies_header = substr( $cookies_header, 0, -2 );
  • wp-includes/class-wp-http-cookie.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    1313 * Returned cookies are represented using this class, and when cookies are set, if they are not
    1414 * already a WP_Http_Cookie() object, then they are turned into one.
    1515 *
    16  * @todo The WordPress convention is to use underscores instead of camelCase for function and method
    1716 * names. Need to switch to use underscores instead for the methods.
    1817 *
    1918 * @since 2.8.0
     
    8483         */
    8584        public function __construct( $data, $requested_url = '' ) {
    8685                if ( $requested_url )
    87                         $arrURL = @parse_url( $requested_url );
     86                        $arrURL = wp_parse_url( $requested_url );
    8887                if ( isset( $arrURL['host'] ) )
    8988                        $this->domain = $arrURL['host'];
    9089                $this->path = isset( $arrURL['path'] ) ? $arrURL['path'] : '/';
     
    190189         *
    191190         * @return string Header encoded cookie name and value.
    192191         */
    193         public function getHeaderValue() {
     192        public function get_header_value() {
    194193                if ( ! isset( $this->name ) || ! isset( $this->value ) )
    195194                        return '';
    196195
     
    205204                return $this->name . '=' . apply_filters( 'wp_http_cookie_value', $this->value, $this->name );
    206205        }
    207206
     207        /**
     208         * Convert cookie name and value back to header string.
     209         *
     210         * @access public
     211         * @since 2.8.0
     212         * @deprecated 4.8.0 Deprecated in favor of get_header_value() method.
     213         *
     214         * @return string Header encoded cookie name and value.
     215         */
     216        public function getHeaderValue() {
     217                _deprecated_function( __METHOD__, '4.8.0', __CLASS__ . '::get_header_value()' );
     218
     219                return $this->get_header_value();
     220        }
     221
    208222        /**
    209223         * Retrieve cookie header for usage in the rest of the WordPress HTTP API.
    210224         *
     
    213227         *
    214228         * @return string
    215229         */
     230        public function get_full_header() {
     231                return 'Cookie: ' . $this->get_header_value();
     232        }
     233
     234        /**
     235         * Retrieve cookie header for usage in the rest of the WordPress HTTP API.
     236         *
     237         * @access public
     238         * @since 2.8.0
     239         * @deprecated 4.4.0 Deprecated in favor of get_full_header() method.
     240         *
     241         * @return string
     242         */
    216243        public function getFullHeader() {
    217                 return 'Cookie: ' . $this->getHeaderValue();
     244                _deprecated_function( __METHOD__, '4.8.0', __CLASS__ . '::get_full_header()' );
     245
     246                return $this->get_full_header();
    218247        }
    219248
    220249        /**
     
    233262         */
    234263        public function get_attributes() {
    235264                return array(
     265                        'name'    => $this->name,
     266                        'value'   => $this->value,
    236267                        'expires' => $this->expires,
    237268                        'path'    => $this->path,
    238269                        'domain'  => $this->domain,