27chan / bazukachan

Keeping Vichan alive
https://27chan.org
Other
16 stars 4 forks source link

mysql_version always determines version < 50503, causing replace utf8mb4 to utf8 #28

Open virtuelles opened 1 year ago

virtuelles commented 1 year ago
// 5.6.10 becomes 50610
function mysql_version() {
    global $pdo;

    $version = $pdo->getAttribute(PDO::ATTR_SERVER_VERSION);
    $v = explode('.', $version);
    if (count($v) != 3)
        return false;
    return (int) sprintf("%02d%02d%02d", $v[0], $v[1], $v[2]);
}

Already tried methods

return 60000

vichan's update

return (int) sprintf("%02d%02d%02d", $v[0], $v[1], is_int($v[2]) ? (int)$v[2] : 0);

All have no effect. I tried to comment out all the places where utf8mb4 would be replaced and successfully installed utf8mb4 character sets. Still don't know where the problem is, there may be something wrong with mysql_version's return.