Skip to content

Commit

Permalink
Merge pull request #19 from Automattic/fix/notices-warnings-update
Browse files Browse the repository at this point in the history
Avoid PHP notice when $hook_extras['plugin'] is not set.
  • Loading branch information
enejb authored Apr 21, 2017
2 parents 281eac2 + fedd24c commit 6f57f5d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jetpack-beta.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,14 @@ static function get_jepack_dev_master_update_response() {
*/
public function upgrader_post_install( $worked, $hook_extras, $result ) {
global $wp_filesystem;
if ( $hook_extras['plugin'] !== JETPACK_DEV_PLUGIN_FILE ) {

if (
! isset( $hook_extras['plugin'] )
|| JETPACK_DEV_PLUGIN_FILE !== $hook_extras['plugin']
) {
return $worked;
}

if ( $wp_filesystem->move( $result['destination'], WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . JETPACK_DEV_PLUGIN_SLUG , true ) ) {
return $worked;
} else {
Expand Down

0 comments on commit 6f57f5d

Please sign in to comment.