@@ -235,21 +235,18 @@ safe:
235
235
php_stream_from_zval_no_verify (stm, parameter);
236
236
if (stm) {
237
237
zend_string *buf;
238
+ zend_string *quoted;
238
239
239
240
buf = php_stream_copy_to_mem (stm, PHP_STREAM_COPY_ALL, 0 );
240
241
if (!buf) {
241
242
buf = ZSTR_EMPTY_ALLOC ();
242
243
}
243
- if (!stmt->dbh ->methods ->quoter (stmt->dbh , ZSTR_VAL (buf), ZSTR_LEN (buf), &plc->quoted , &plc->qlen ,
244
- param->param_type )) {
245
- /* bork */
246
- ret = -1 ;
247
- strncpy (stmt->error_code , stmt->dbh ->error_code , 6 );
248
- if (buf) {
249
- zend_string_release_ex (buf, 0 );
250
- }
251
- goto clean_up;
252
- }
244
+
245
+ quoted = stmt->dbh ->methods ->quoter (stmt->dbh , buf, param->param_type );
246
+
247
+ plc->quoted = ZSTR_VAL (quoted);
248
+ plc->qlen = ZSTR_LEN (quoted);
249
+
253
250
if (buf) {
254
251
zend_string_release_ex (buf, 0 );
255
252
}
@@ -289,12 +286,10 @@ safe:
289
286
plc->freeq = 0 ;
290
287
break ;
291
288
292
- default :
289
+ default : {
293
290
buf = zval_get_string (parameter);
294
- if (EG (exception) ||
295
- !stmt->dbh ->methods ->quoter (stmt->dbh , ZSTR_VAL (buf),
296
- ZSTR_LEN (buf), &plc->quoted , &plc->qlen ,
297
- param_type)) {
291
+
292
+ if (EG (exception)) {
298
293
/* bork */
299
294
ret = -1 ;
300
295
strncpy (stmt->error_code , stmt->dbh ->error_code , 6 );
@@ -303,7 +298,12 @@ safe:
303
298
}
304
299
goto clean_up;
305
300
}
301
+
302
+ zend_string *quoted = stmt->dbh ->methods ->quoter (stmt->dbh , buf, param->param_type );
303
+ plc->quoted = ZSTR_VAL (quoted);
304
+ plc->qlen = ZSTR_LEN (quoted);
306
305
plc->freeq = 1 ;
306
+ }
307
307
}
308
308
309
309
if (buf) {
0 commit comments