File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
src/lib/Sympa/DatabaseDriver Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -72,10 +72,10 @@ sub quote {
72
72
my $string = shift ;
73
73
my $data_type = shift ;
74
74
75
- # Set utf8 flag, because DBD::Pg 3.x needs utf8 flag for input parameters
76
- # even if pg_enable_utf8 option is disabled.
77
- unless (0 == index ( $DBD::Pg::VERSION , ' 2 ' )
78
- or (ref $data_type eq ' HASH' and $data_type -> {pg_type })) {
75
+ # Set utf8 flag. Because DBD::Pg 3.3.0 to 3.5.x need utf8 flag for input
76
+ # parameters, even if pg_enable_utf8 option is disabled.
77
+ if ( $DBD::Pg::VERSION =~ / \A 3[.][3-5] \b /
78
+ and not (ref $data_type eq ' HASH' and $data_type -> {pg_type })) {
79
79
$string = Encode::decode_utf8($string );
80
80
}
81
81
return $self -> SUPER::quote($string , $data_type );
@@ -85,9 +85,9 @@ sub do_prepared_query {
85
85
my $self = shift ;
86
86
my $query = shift ;
87
87
88
- # Set utf8 flag, because DBD::Pg 3.x needs utf8 flag for input parameters
89
- # even if pg_enable_utf8 option is disabled.
90
- unless (0 == index ( $DBD::Pg::VERSION , ' 2 ' ) ) {
88
+ # Set utf8 flag. Because DBD::Pg 3.3.0 to 3.5.x need utf8 flag for input
89
+ # parameters, even if pg_enable_utf8 option is disabled.
90
+ if ( $DBD::Pg::VERSION =~ / \A 3[.][3-5] \b / ) {
91
91
my @params ;
92
92
while (scalar @_ ) {
93
93
my $p = shift ;
You can’t perform that action at this time.
0 commit comments