diff options
author | Christian Schneider | 2020-06-25 19:20:20 +0200 |
---|---|---|
committer | Christian Schneider | 2020-06-25 19:20:20 +0200 |
commit | b0d2c679c6dba0120fac924ee3e35e64b174d6e5 (patch) | |
tree | c5a9f61311da6ceb94bf58d41ccd65063e1d3aab | |
parent | 53cc7ab05afb41a80b710fa1f4454a8e4cb372ab (diff) | |
download | itools-b0d2c679c6dba0120fac924ee3e35e64b174d6e5.tar.gz itools-b0d2c679c6dba0120fac924ee3e35e64b174d6e5.tar.bz2 itools-b0d2c679c6dba0120fac924ee3e35e64b174d6e5.zip |
Call old _read_post_process/_write_pre_process last to preserve old semantics as they can have side-effects
-rw-r--r-- | it_dbi.class | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/it_dbi.class b/it_dbi.class index 4064465..2c16b90 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -762,8 +762,6 @@ function iterate() $this->_result->close(); } - $this->_read_post_process(); - if (is_array($this->_data)) { $originalfields = array_keys($this->_data); @@ -776,6 +774,7 @@ function iterate() $this->$field = $value; } + $this->_read_post_process(); } else $this->_nofetch = false; @@ -798,8 +797,8 @@ function insert($tags = array(), $command = "INSERT") $this->_connect(); /* Pre-processing, $tags is passed by reference and may be modified here */ - $this->_write_pre_process($tags, $command); $tags = static::_write_preprocess($tags); + $this->_write_pre_process($tags, $command); if ($this->_p['randomid'] && !isset($tags[$this->_p['keyfield']])) $tags[$this->_p['keyfield']] = bin2hex(random_bytes(16)); @@ -857,8 +856,8 @@ function update($tags = array(), $where = null) $result = 0; # in case we optimize away the query /* Pre-processing, $tags is passed by reference and may be modified here */ - $this->_write_pre_process($tags, 'UPDATE'); $tags = static::_write_preprocess($tags); + $this->_write_pre_process($tags, 'UPDATE'); if ($set = $this->_set($tags, isset($where))) { |