* @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.
* 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 ) );
}
/*
* The order for requests is cURL, and then PHP Streams.
*
* @since 3.2.0
+ *
+ * @static
* @access private
*
* @param string $url URL to Request
* @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.
*/
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, '*') ) {
* when URL parsing failed.
*
* @since 4.1.0
+ *
+ * @static
* @access protected
*
* @param string $url The URL to parse.
*
* @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.
*
* @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.
* @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' ) )
* @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' ) )
*
* @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.
*/
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, '*') ) {
* @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 ) )
*
* @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.
*
* @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.
* @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.
*/
*
* @since 2.8.0
*
+ * @static
+ *
* @param string $url
* @param array $args
* @return string Types of encoding to accept.
*
* @since 2.8.0
*
+ * @static
+ *
* @return string Content-Encoding string to send in the header.
*/
public static function content_encoding() {
*
* @since 2.8.0
*
+ * @static
+ *
* @param array|string $headers All of the available headers.
* @return bool
*/
*
* @since 2.8.0
*
+ * @static
+ *
* @return bool
*/
public static function is_available() {