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

Get rid of recursive calls in class phpbb_notification_manager

    XMLWordPrintable

Details

    Description

      Allowing different types of arguments to functions (e.g. int|array) make them unnecessarily complex. Instead, two functions/methods should be used that have clearly defined parameters.

      Also, some of the recursive calls do not seem to make any sense at all.

      	public function delete_notifications($item_type, $item_id)
      	{
      		if (is_array($item_type))
      		{
      			foreach ($item_type as $type)
      			{
      				$this->delete_notifications($type, $item_id);
      			}
       
      			return;
      		}
      

      Why would one want to delete topic_id 4242123 and post_id 4242123 at the same time? They have nothing to do with each other.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: