qriouslad / system-dashboard

Centralized dashboard to monitor various WordPress components, stats and data, including the server.
https://wordpress.org/plugins/system-dashboard/
GNU General Public License v2.0
31 stars 3 forks source link

Undefined array key 1 in ... wp-content\plugins\system-dashboard\admin\class-system-dashboard-admin.php on line 1394 #24

Open agussuhartono opened 1 year ago

agussuhartono commented 1 year ago

Undefined array key 1 in ... wp-content\plugins\system-dashboard\admin\class-system-dashboard-admin.php on line 1394

Plugin version : 2.8.7

public function sd_os_info() {

    if ( $this->is_shell_exec_enabled() ) {

        $os = shell_exec( 'lsb_release -a' );
        $os = str_replace( "Description", " | Description", $os );
        $os = str_replace( "Release", " | Release", $os );
        $os = str_replace( "Codename", " | Codename", $os );
        $os_array = explode(" | ", $os);
        $os = $os_array[1]; // <=======================
        $os = str_replace( ":", "", $os );
        $os = str_replace( "Description", "", $os );

        if ( empty( $os ) ) {
            $os = 'Undetectable';
        }

    } else {

        $os = php_uname( 's' ) .' | '. php_uname( 'r' ) .' | '. php_uname( 'v' );

    }

    return $os;

}