Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11446

Use sql_in_set as designed and consistent with the rest of phpBB code in phpbb_notification_manager

    Details

      Description

      For example the following SQL query has unnecessarily high readability-complexity which sql_in_set is supposed to take away.

      		$sql = 'UPDATE ' . $this->notifications_table . "
      			SET notification_read = 1
      			WHERE item_type = '" . $this->db->sql_escape($item_type) . "'
      				AND notification_time <= " . (int) $time .
      				(($item_parent_id !== false) ? ' AND ' . (is_array($item_parent_id) ? $this->db->sql_in_set('item_parent_id', $item_parent_id) : 'item_parent_id = ' . (int) $item_parent_id) : '') .
      				(($user_id !== false) ? ' AND ' . (is_array($user_id) ? $this->db->sql_in_set('user_id', $user_id) : 'user_id = ' . (int) $user_id) : '');
      		$this->db->sql_query($sql);
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bantu bantu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: