Changeset 28506 for trunk/src/wp-includes/class-http.php
- Timestamp:
- 05/19/2014 05:33:08 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-http.php
r28317 r28506 65 65 * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error 66 66 */ 67 function request( $url, $args = array() ) {67 public function request( $url, $args = array() ) { 68 68 global $wp_version; 69 69 … … 373 373 * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error 374 374 */ 375 function post($url, $args = array()) {375 public function post($url, $args = array()) { 376 376 $defaults = array('method' => 'POST'); 377 377 $r = wp_parse_args( $args, $defaults ); … … 391 391 * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error 392 392 */ 393 function get($url, $args = array()) {393 public function get($url, $args = array()) { 394 394 $defaults = array('method' => 'GET'); 395 395 $r = wp_parse_args( $args, $defaults ); … … 409 409 * @return array|object Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error 410 410 */ 411 function head($url, $args = array()) {411 public function head($url, $args = array()) { 412 412 $defaults = array('method' => 'HEAD'); 413 413 $r = wp_parse_args( $args, $defaults ); … … 592 592 * @return bool True to block, false to allow. 593 593 */ 594 function block_request($uri) {594 public function block_request($uri) { 595 595 // We don't need to block requests, because nothing is blocked. 596 596 if ( ! defined( 'WP_HTTP_BLOCK_EXTERNAL' ) || ! WP_HTTP_BLOCK_EXTERNAL ) … … 639 639 } 640 640 641 static function make_absolute_url( $maybe_relative_path, $url ) {641 public static function make_absolute_url( $maybe_relative_path, $url ) { 642 642 if ( empty( $url ) ) 643 643 return $maybe_relative_path; … … 698 698 * @return false|object False if no redirect is present, a WP_HTTP or WP_Error result otherwise. 699 699 */ 700 static function handle_redirects( $url, $args, $response ) {700 public static function handle_redirects( $url, $args, $response ) { 701 701 // If no redirects are present, or, redirects were not requested, perform no action. 702 702 if ( ! isset( $response['headers']['location'] ) || 0 === $args['_redirection'] ) … … 752 752 * @return integer|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure 753 753 */ 754 static function is_ip_address( $maybe_ip ) {754 public static function is_ip_address( $maybe_ip ) { 755 755 if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) ) 756 756 return 4; … … 784 784 * @return array 'headers', 'body', 'response', 'cookies' and 'filename' keys. 785 785 */ 786 function request($url, $args = array()) {786 public function request($url, $args = array()) { 787 787 $defaults = array( 788 788 'method' => 'GET', 'timeout' => 5, … … 1068 1068 * @return bool If the cerficiate presented in $stream is valid for $host 1069 1069 */ 1070 static function verify_ssl_certificate( $stream, $host ) {1070 public static function verify_ssl_certificate( $stream, $host ) { 1071 1071 $context_options = stream_context_get_options( $stream ); 1072 1072 … … 1219 1219 * @return array 'headers', 'body', 'response', 'cookies' and 'filename' keys. 1220 1220 */ 1221 function request($url, $args = array()) {1221 public function request($url, $args = array()) { 1222 1222 $defaults = array( 1223 1223 'method' => 'GET', 'timeout' => 5, … … 1544 1544 * @return bool 1545 1545 */ 1546 function is_enabled() {1546 public function is_enabled() { 1547 1547 return defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT'); 1548 1548 } … … 1558 1558 * @return bool 1559 1559 */ 1560 function use_authentication() {1560 public function use_authentication() { 1561 1561 return defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD'); 1562 1562 } … … 1569 1569 * @return string 1570 1570 */ 1571 function host() {1571 public function host() { 1572 1572 if ( defined('WP_PROXY_HOST') ) 1573 1573 return WP_PROXY_HOST; … … 1583 1583 * @return string 1584 1584 */ 1585 function port() {1585 public function port() { 1586 1586 if ( defined('WP_PROXY_PORT') ) 1587 1587 return WP_PROXY_PORT; … … 1597 1597 * @return string 1598 1598 */ 1599 function username() {1599 public function username() { 1600 1600 if ( defined('WP_PROXY_USERNAME') ) 1601 1601 return WP_PROXY_USERNAME; … … 1611 1611 * @return string 1612 1612 */ 1613 function password() {1613 public function password() { 1614 1614 if ( defined('WP_PROXY_PASSWORD') ) 1615 1615 return WP_PROXY_PASSWORD; … … 1625 1625 * @return string 1626 1626 */ 1627 function authentication() {1627 public function authentication() { 1628 1628 return $this->username() . ':' . $this->password(); 1629 1629 } … … 1636 1636 * @return string 1637 1637 */ 1638 function authentication_header() {1638 public function authentication_header() { 1639 1639 return 'Proxy-Authorization: Basic ' . base64_encode( $this->authentication() ); 1640 1640 } … … 1653 1653 * @return bool True, to send through the proxy and false if, the proxy should not be used. 1654 1654 */ 1655 function send_through_proxy( $uri ) {1655 public function send_through_proxy( $uri ) { 1656 1656 // parse_url() only handles http, https type URLs, and will emit E_WARNING on failure. 1657 1657 // This will be displayed on blogs, which is not reasonable. … … 1727 1727 * @var string 1728 1728 */ 1729 var$name;1729 public $name; 1730 1730 1731 1731 /** … … 1735 1735 * @var string 1736 1736 */ 1737 var$value;1737 public $value; 1738 1738 1739 1739 /** … … 1743 1743 * @var string 1744 1744 */ 1745 var$expires;1745 public $expires; 1746 1746 1747 1747 /** … … 1751 1751 * @var string 1752 1752 */ 1753 var$path;1753 public $path; 1754 1754 1755 1755 /** … … 1759 1759 * @var string 1760 1760 */ 1761 var$domain;1761 public $domain; 1762 1762 1763 1763 /** … … 1783 1783 * @param string $requested_url The URL which the cookie was set on, used for default 'domain' and 'port' values 1784 1784 */ 1785 function __construct( $data, $requested_url = '' ) {1785 public function __construct( $data, $requested_url = '' ) { 1786 1786 if ( $requested_url ) 1787 1787 $arrURL = @parse_url( $requested_url ); … … 1843 1843 * @return boolean true if allowed, false otherwise. 1844 1844 */ 1845 function test( $url ) {1845 public function test( $url ) { 1846 1846 if ( is_null( $this->name ) ) 1847 1847 return false; … … 1887 1887 * @return string Header encoded cookie name and value. 1888 1888 */ 1889 function getHeaderValue() {1889 public function getHeaderValue() { 1890 1890 if ( ! isset( $this->name ) || ! isset( $this->value ) ) 1891 1891 return ''; … … 1910 1910 * @return string 1911 1911 */ 1912 function getFullHeader() {1912 public function getFullHeader() { 1913 1913 return 'Cookie: ' . $this->getHeaderValue(); 1914 1914 }
Note: See TracChangeset
for help on using the changeset viewer.