Fix bug where rcube_contacts::get_record() could return cached result when requested record wasn't found (#5218)
| | |
| | | /** |
| | | * Get a specific contact record |
| | | * |
| | | * @param mixed record identifier(s) |
| | | * @param mixed Record identifier(s) |
| | | * @param boolean True to return record as associative array, otherwise a result set is returned |
| | | * |
| | | * @return mixed Result object with all record fields or False if not found |
| | | * @return rcube_result_set|array Result object with all record fields |
| | | */ |
| | | abstract function get_record($id, $assoc=false); |
| | | |
| | |
| | | * @param mixed $id Record identifier(s) |
| | | * @param bool $assoc Enables returning associative array |
| | | * |
| | | * @return mixed Result object with all record fields or False if not found |
| | | * @return rcube_result_set|array Result object with all record fields |
| | | */ |
| | | function get_record($id, $assoc = false) |
| | | { |
| | |
| | | $this->user_id |
| | | ); |
| | | |
| | | $this->result = null; |
| | | |
| | | if ($sql_arr = $this->db->fetch_assoc()) { |
| | | $record = $this->convert_db_data($sql_arr); |
| | | $this->result = new rcube_result_set(1); |