diff options
author | Xinchen Hui <laruence@gmail.com> | 2016-01-04 05:38:15 -0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2016-01-04 05:38:15 -0800 |
commit | 36b4311edd3e2dec31de1582c207e83b09d6f42b (patch) | |
tree | 5617c49e9cc1f7dacdcd72423293907df507470b /ext/pdo_pgsql/pgsql_driver.c | |
parent | 919562d53b539566b89baa3e551dd84c0702bc6e (diff) | |
download | php-git-36b4311edd3e2dec31de1582c207e83b09d6f42b.tar.gz |
Do not edit the value in place (might be relates to #71261)
Diffstat (limited to 'ext/pdo_pgsql/pgsql_driver.c')
-rw-r--r-- | ext/pdo_pgsql/pgsql_driver.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 5c19c209b3..3f92525506 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -1152,16 +1152,15 @@ static const zend_function_entry *pdo_pgsql_get_driver_methods(pdo_dbh_t *dbh, i static int pdo_pgsql_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val) { + zend_bool bval = zval_get_long(val)? 1 : 0; pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; switch (attr) { case PDO_ATTR_EMULATE_PREPARES: - convert_to_long(val); - H->emulate_prepares = 0 != Z_LVAL_P(val); + H->emulate_prepares = bval; return 1; case PDO_PGSQL_ATTR_DISABLE_PREPARES: - convert_to_long(val); - H->disable_prepares = 0 != Z_LVAL_P(val); + H->disable_prepares = bval; return 1; default: return 0; |