Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter for sslverify on zip url #20

Merged
merged 2 commits into from Sep 16, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions updater.php
Expand Up @@ -71,6 +71,9 @@ public function __construct( $config = array() ) {


// set timeout // set timeout
add_filter( 'http_request_timeout', array( $this, 'http_request_timeout' ) ); add_filter( 'http_request_timeout', array( $this, 'http_request_timeout' ) );

// set sslverify for zip download
add_filter( 'http_request_args', array( $this, 'http_request_sslverify' ), 10, 2 );
} }




Expand Down Expand Up @@ -119,6 +122,21 @@ public function http_request_timeout() {
return 2; return 2;
} }


/**
* Callback fn for the http_request_args filter
*
* @param $args
* @param $url
*
* @return mixed
*/
public function http_request_sslverify ( $args, $url ) {
if ( $this->config[ 'zip_url' ] == $url )
$args[ 'sslverify' ] = $this->config[ 'sslverify' ];

return $args;
}



/** /**
* Delete transients (runs when WP_DEBUG is on) * Delete transients (runs when WP_DEBUG is on)
Expand Down