Skip to content

bug: MariaDB detection uses loose stripos comparison in upgrade advisor #270

@somethingwithproof

Description

@somethingwithproof

Description

The upgrade advisor uses a loose comparison when detecting MariaDB:

if (stripos($database['Value'], 'mariadb') == false) {
    unset($fields_syslog_update['engine']['array']['aria']);
} else {
    $fields_syslog_update['engine']['value'] = 'aria';
}

Location:

  • setup.php (around line 966)

Why this is a bug

stripos() returns either an integer position or false.
Using == false is ambiguous and can mis-handle index 0 as not found.

Expected

Use strict comparison:

if (stripos($database['Value'], 'mariadb') === false) {
    ...
}

This keeps behavior consistent and avoids subtle detection errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions