Wordpress++

This commit is contained in:
nikolark committed 2015-08-22 18:55:55 +02:00
1 parent 790f1487a2
commit 3f49ab1747
610 files changed
+58979 -36562

No files matched your search

+40 -10
View File
@@ -36,6 +36,8 @@ class WP_Http {
* @access public
* @since 2.7.0
*
* @global string $wp_version
*
* @param string $url The request URL.
* @param string|array $args {
* Optional. Array or string of HTTP request arguments.
@@ -211,7 +213,7 @@ class WP_Http {
* and pick its name using the basename of the $url.
*/
if ( $r['stream'] && empty( $r['filename'] ) ) {
$r['filename'] = wp_unique_filename( get_temp_dir(), basename( $url ) );
$r['filename'] = get_temp_dir() . wp_unique_filename( get_temp_dir(), basename( $url ) );
}
/*
@@ -339,6 +341,8 @@ class WP_Http {
* The order for requests is cURL, and then PHP Streams.
*
* @since 3.2.0
*
* @static
* @access private
*
* @param string $url URL to Request
@@ -624,6 +628,9 @@ class WP_Http {
* @link https://core.trac.wordpress.org/ticket/8927 Allow preventing external requests.
* @link https://core.trac.wordpress.org/ticket/14636 Allow wildcard domains in WP_ACCESSIBLE_HOSTS
*
* @staticvar array|null $accessible_hosts
* @staticvar array $wildcard_regex
*
* @param string $uri URI of url.
* @return bool True to block, false to allow.
*/
@@ -654,9 +661,9 @@ class WP_Http {
if ( !defined('WP_ACCESSIBLE_HOSTS') )
return true;
static $accessible_hosts;
static $wildcard_regex = false;
if ( null == $accessible_hosts ) {
static $accessible_hosts = null;
static $wildcard_regex = array();
if ( null === $accessible_hosts ) {
$accessible_hosts = preg_split('|,\s*|', WP_ACCESSIBLE_HOSTS);
if ( false !== strpos(WP_ACCESSIBLE_HOSTS, '*') ) {
@@ -685,6 +692,8 @@ class WP_Http {
* when URL parsing failed.
*
* @since 4.1.0
*
* @static
* @access protected
*
* @param string $url The URL to parse.
@@ -723,7 +732,9 @@ class WP_Http {
*
* @since 3.4.0
*
* @static
* @access public
*
* @param string $maybe_relative_path The URL which might be relative
* @param string $url The URL which $maybe_relative_path is relative to
* @return string An Absolute URL, in a failure condition where the URL cannot be parsed, the relative URL will be returned.
@@ -794,6 +805,8 @@ class WP_Http {
*
* @since 3.7.0
*
* @static
*
* @param string $url The URL which was requested.
* @param array $args The Arguments which were used to make the request.
* @param array $response The Response of the HTTP request.
@@ -1242,7 +1255,7 @@ class WP_Http_Streams {
* @since 2.7.0
* @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client().
*
* @return boolean False means this class can not be used, true means it can.
* @return bool False means this class can not be used, true means it can.
*/
public static function test( $args = array() ) {
if ( ! function_exists( 'stream_socket_client' ) )
@@ -1621,7 +1634,7 @@ class WP_Http_Curl {
* @static
* @since 2.7.0
*
* @return boolean False means this class can not be used, true means it can.
* @return bool False means this class can not be used, true means it can.
*/
public static function test( $args = array() ) {
if ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) )
@@ -1796,6 +1809,9 @@ class WP_HTTP_Proxy {
*
* @since 2.8.0
*
* @staticvar array|null $bypass_hosts
* @staticvar array $wildcard_regex
*
* @param string $uri URI to check.
* @return bool True, to send through the proxy and false if, the proxy should not be used.
*/
@@ -1835,9 +1851,9 @@ class WP_HTTP_Proxy {
if ( !defined('WP_PROXY_BYPASS_HOSTS') )
return true;
static $bypass_hosts;
static $wildcard_regex = false;
if ( null == $bypass_hosts ) {
static $bypass_hosts = null;
static $wildcard_regex = array();
if ( null === $bypass_hosts ) {
$bypass_hosts = preg_split('|,\s*|', WP_PROXY_BYPASS_HOSTS);
if ( false !== strpos(WP_PROXY_BYPASS_HOSTS, '*') ) {
@@ -1993,7 +2009,7 @@ class WP_Http_Cookie {
* @since 2.8.0
*
* @param string $url URL you intend to send this cookie to
* @return boolean true if allowed, false otherwise.
* @return bool true if allowed, false otherwise.
*/
public function test( $url ) {
if ( is_null( $this->name ) )
@@ -2085,6 +2101,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @param string $raw String to compress.
* @param int $level Optional, default is 9. Compression level, 9 is highest.
* @param string $supports Optional, not used. When implemented it will choose the right compression based on what the server supports.
@@ -2104,6 +2122,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @param string $compressed String to decompress.
* @param int $length The optional length of the compressed data.
* @return string|bool False on failure.
@@ -2149,6 +2169,8 @@ class WP_Http_Encoding {
* @link http://au2.php.net/manual/en/function.gzinflate.php#70875
* @link http://au2.php.net/manual/en/function.gzinflate.php#77336
*
* @static
*
* @param string $gzData String to decompress.
* @return string|bool False on failure.
*/
@@ -2188,6 +2210,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @param string $url
* @param array $args
* @return string Types of encoding to accept.
@@ -2234,6 +2258,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @return string Content-Encoding string to send in the header.
*/
public static function content_encoding() {
@@ -2245,6 +2271,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @param array|string $headers All of the available headers.
* @return bool
*/
@@ -2268,6 +2296,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @return bool
*/
public static function is_available() {