Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-11446

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

XMLWordPrintable

      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);
      

            Unassigned Unassigned
            bantu Andreas Fischer [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: