Skip to content

Commit

Permalink
Merge pull request #61 from Automattic/fix/empty-usage-on-return-value
Browse files Browse the repository at this point in the history
Assign value to variable instead of checking with empty() on the return value.
  • Loading branch information
oskosk authored Apr 21, 2018
2 parents 4caca39 + 70431c9 commit 10d9b64
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jetpack-beta.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Jetpack Beta Tester
* Plugin URI: https://jetpack.com/beta/
* Description: Use the Beta plugin to get a sneak peek at new features and test them on your site.
* Version: 2.2.0
* Version: 2.2.1
* Author: Automattic
* Author URI: https://jetpack.com/
* License: GPLv2 or later
Expand Down Expand Up @@ -1036,7 +1036,10 @@ static function run_autoupdate() {
if ( empty( $admin_email ) ) {
return;
}
$site_title = ! empty( get_bloginfo( 'name' ) ) ? get_bloginfo( 'name' ) : get_site_url();
// Calling empty() on a function return value crashes in PHP < 5.5.
// Thus we assign the return value explicitly and then check with empty().
$bloginfo_name = get_bloginfo( 'name' );
$site_title = ! empty( $bloginfo_name ) ? get_bloginfo( 'name' ) : get_site_url();
$what_updated = 'Jetpack Beta Tester Plugin';
$subject = sprintf( __( '[%s] Autoupdated Jetpack Beta Tester', 'jetpack-beta' ), $site_title );
if ( in_array( JETPACK_DEV_PLUGIN_FILE, $plugins ) ) {
Expand Down

0 comments on commit 10d9b64

Please sign in to comment.