Skip to content

Commit

Permalink
Fix #11560: ADOdb version check in check.php is incorrect
Browse files Browse the repository at this point in the history
See upstream bug report
http://phplens.com/lens/lensforum/msgs.php?id=18320 for the reason as to
why this change is necessary. version_compare works with strings, not
float values. And the Version() function in ADOdb should not be
returning floats anyway (there is no way to determine if the version if
5.1 or 5.10 from a float value).
  • Loading branch information
davidhicks committed Feb 27, 2010
1 parent 5ea2691 commit 76cd989
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion admin/check.php
Expand Up @@ -261,7 +261,15 @@ function test_database_utf8() {
print_info_row( 'Database is not connected - Can not continue checks' );
}

print_test_warn_row( 'Checking adodb version...', version_compare( $g_db->Version(), '5.05', '>=' ), $g_db->Version() );
if( isset( $ADODB_vers ) ) {
# ADOConnection::Version() is broken as it treats v5.1 the same as v5.10
# Therefore we must extract the correct version ourselves
# Upstream bug report: http://phplens.com/lens/lensforum/msgs.php?id=18320
if( preg_match( '/^[Vv]([0-9\.]+)/', $ADODB_vers, $t_matches ) == 1 ) {
$t_adodb_version_check_ok = version_compare( $t_matches[1], '5.10', '>=' );
}
}
print_test_warn_row( 'Checking adodb version...', $t_adodb_version_check_ok, $ADODB_vers );

print_test_row('Checking using bundled adodb with some drivers...', !(db_is_pgsql() || db_is_mssql() || db_is_db2()) || strstr($ADODB_vers, 'MantisBT Version') !== false );
$t_serverinfo = $g_db->ServerInfo();
Expand Down

0 comments on commit 76cd989

Please sign in to comment.