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

Get rid of recursive calls in class phpbb_notification_manager

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.0.0-a1
    • 3.1.0-dev
    • Notification System
    • None

      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.

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

              Created:
              Updated:
              Resolved: