Skip to content

Commit

Permalink
Added checks for header response. So on lack of network pluginify wil…
Browse files Browse the repository at this point in the history
…l work
  • Loading branch information
stas committed Sep 14, 2011
1 parent 255ca66 commit fde6678
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pluginify.php
Expand Up @@ -65,6 +65,7 @@ function error( $code, $args ) {
default:
printf( "Unknown error code %d with arguments: %s.\n", $code, json_encode( $args ) );
}

self::help();
}

Expand Down Expand Up @@ -122,8 +123,7 @@ function whoami() {
function process( $plugin ) {

$headers = get_headers( "http://plugins.svn.wordpress.org/{$plugin}/" );

if ( $headers['0'] !== 'HTTP/1.1 404 Not Found' ) {
if ( $headers && $headers['0'] == 'HTTP/1.1 200 OK' ) {
self::error( 4, $plugin ); // Failure with plugin namespace
return;
}
Expand Down

0 comments on commit fde6678

Please sign in to comment.