Skip to content

Commit b54a830

Browse files
andyzitoschlessera
authored andcommitted
Foolproof site_id fetching
Co-Authored-By: Alain Schlesser <alain.schlesser@gmail.com>
1 parent 0a89f74 commit b54a830

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Core_Command.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,8 @@ private function multisite_convert_( $assoc_args ) {
660660
$assoc_args['subdomains']
661661
);
662662

663-
$site_id = $wpdb->get_var("SELECT id FROM $wpdb->site");
663+
$site_id = $wpdb->get_var( "SELECT id FROM $wpdb->site" );
664+
$site_id = ( null === $site_id ) ? 1 : (int) $site_id;
664665

665666
if ( true === $result ) {
666667
WP_CLI::log( 'Set up multisite database tables.' );

0 commit comments

Comments
 (0)