@@ -598,7 +598,8 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
598
598
}
599
599
}
600
600
pgsql = (PGconn * ) le -> ptr ;
601
- if (PQprotocolVersion (pgsql ) >= 3 && atof (PQparameterStatus (pgsql , "server_version" )) >= 7.2 ) {
601
+ /* consider to use php_version_compare() here */
602
+ if (PQprotocolVersion (pgsql ) >= 3 && zend_strtod (PQparameterStatus (pgsql , "server_version" ), NULL ) >= 7.2 ) {
602
603
pg_result = PQexec (pgsql , "RESET ALL;" );
603
604
PQclear (pg_result );
604
605
}
@@ -4063,14 +4064,16 @@ PHP_FUNCTION(pg_get_notify)
4063
4064
if (result_type & PGSQL_NUM ) {
4064
4065
add_index_string (return_value , 0 , pgsql_notify -> relname );
4065
4066
add_index_long (return_value , 1 , pgsql_notify -> be_pid );
4066
- if (PQprotocolVersion (pgsql ) >= 3 && atof (PQparameterStatus (pgsql , "server_version" )) >= 9.0 ) {
4067
+ /* consider to use php_version_compare() here */
4068
+ if (PQprotocolVersion (pgsql ) >= 3 && zend_strtod (PQparameterStatus (pgsql , "server_version" ), NULL ) >= 9.0 ) {
4067
4069
add_index_string (return_value , 2 , pgsql_notify -> extra );
4068
4070
}
4069
4071
}
4070
4072
if (result_type & PGSQL_ASSOC ) {
4071
4073
add_assoc_string (return_value , "message" , pgsql_notify -> relname );
4072
4074
add_assoc_long (return_value , "pid" , pgsql_notify -> be_pid );
4073
- if (PQprotocolVersion (pgsql ) >= 3 && atof (PQparameterStatus (pgsql , "server_version" )) >= 9.0 ) {
4075
+ /* consider to use php_version_compare() here */
4076
+ if (PQprotocolVersion (pgsql ) >= 3 && zend_strtod (PQparameterStatus (pgsql , "server_version" ), NULL ) >= 9.0 ) {
4074
4077
add_assoc_string (return_value , "payload" , pgsql_notify -> extra );
4075
4078
}
4076
4079
}
0 commit comments