Changeset 50762
- Timestamp:
- 04/16/2021 11:59:14 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-automatic-updater.php
r50759 r50762 152 152 153 153 // If we can't do an auto core update, we may still be able to email the user. 154 if ( ! $skin->request_filesystem_credentials( false, $context, $allow_relaxed_file_ownership ) || $this->is_vcs_checkout( $context ) ) { 154 if ( ! $skin->request_filesystem_credentials( false, $context, $allow_relaxed_file_ownership ) 155 || $this->is_vcs_checkout( $context ) 156 ) { 155 157 if ( 'core' === $type ) { 156 158 $this->send_core_update_notification_email( $item ); … … 257 259 if ( $notified 258 260 && get_site_option( 'admin_email' ) === $notified['email'] 259 && $notified['version'] == $item->current261 && $notified['version'] === $item->current 260 262 ) { 261 263 return false; … … 634 636 && 'fail' === $notified['type'] 635 637 && get_site_option( 'admin_email' ) === $notified['email'] 636 && $notified['version'] == $core_update->current638 && $notified['version'] === $core_update->current 637 639 ) { 638 640 $send = false; … … 683 685 } 684 686 685 $newer_version_available = ( 'upgrade' === $next_user_core_update->response && version_compare( $next_user_core_update->version, $core_update->version, '>' ) ); 687 if ( 'upgrade' === $next_user_core_update->response 688 && version_compare( $next_user_core_update->version, $core_update->version, '>' ) 689 ) { 690 $newer_version_available = true; 691 } else { 692 $newer_version_available = false; 693 } 686 694 687 695 /** … … 1190 1198 } else { 1191 1199 $body[] = sprintf( 1192 1200 /* translators: 1: Theme name, 2: Version number. */ 1193 1201 __( '- %1$s version %2$s' ), 1194 1202 $item->name, … … 1281 1289 if ( isset( $this->update_results['core'] ) ) { 1282 1290 $result = $this->update_results['core'][0]; 1291 1283 1292 if ( $result->result && ! is_wp_error( $result->result ) ) { 1284 1293 /* translators: %s: WordPress version. */ … … 1289 1298 $failures++; 1290 1299 } 1300 1291 1301 $body[] = ''; 1292 1302 } … … 1297 1307 continue; 1298 1308 } 1309 1299 1310 $success_items = wp_list_filter( $this->update_results[ $type ], array( 'result' => true ) ); 1311 1300 1312 if ( $success_items ) { 1301 1313 $messages = array( … … 1311 1323 } 1312 1324 } 1313 if ( $success_items != $this->update_results[ $type ] ) { 1325 1326 if ( $success_items !== $this->update_results[ $type ] ) { 1314 1327 // Failed updates. 1315 1328 $messages = array( … … 1320 1333 1321 1334 $body[] = $messages[ $type ]; 1335 1322 1336 foreach ( $this->update_results[ $type ] as $item ) { 1323 1337 if ( ! $item->result || is_wp_error( $item->result ) ) { … … 1328 1342 } 1329 1343 } 1344 1330 1345 $body[] = ''; 1331 1346 } 1332 1347 1333 1348 $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ); 1349 1334 1350 if ( $failures ) { 1335 1351 $body[] = trim( … … 1368 1384 continue; 1369 1385 } 1386 1370 1387 foreach ( $this->update_results[ $type ] as $update ) { 1371 1388 $body[] = $update->name; 1372 1389 $body[] = str_repeat( '-', strlen( $update->name ) ); 1390 1373 1391 foreach ( $update->messages as $message ) { 1374 1392 $body[] = ' ' . html_entity_decode( str_replace( '…', '...', $message ) ); 1375 1393 } 1394 1376 1395 if ( is_wp_error( $update->result ) ) { 1377 1396 $results = array( 'update' => $update->result ); 1397 1378 1398 // If we rolled back, we want to know an error that occurred then too. 1379 1399 if ( 'rollback_was_required' === $update->result->get_error_code() ) { 1380 1400 $results = (array) $update->result->get_error_data(); 1381 1401 } 1402 1382 1403 foreach ( $results as $result_type => $result ) { 1383 1404 if ( ! is_wp_error( $result ) ) { … … 1398 1419 } 1399 1420 } 1421 1400 1422 $body[] = ''; 1401 1423 }
Note: See TracChangeset
for help on using the changeset viewer.