Skip to content

Commit

Permalink
Assign value to variable instead of checking with empty() on the retu…
Browse files Browse the repository at this point in the history
…rn value. This avoids fatal error in PHP < 5.5
  • Loading branch information
oskosk committed Apr 21, 2018
1 parent 4caca39 commit 499f490
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jetpack-beta.php
Original file line number Diff line number Diff line change
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 499f490

Please sign in to comment.