*

Maximiliano

  • *
  • 3 posts
Hard bug items unlimited added
« on: November 09, 2023, 08:14:32 PM »
I am interacting directly with the ad submission by sending them via POST to the page. After logging in using an external software (executable created by me), I happened to notice that after the POST submission of the ad, an almost unlimited redirect occurs (which I can manage from the executable), creating an unlimited number of copies of the same ad.

To clarify, if I send the data to the page mainwebsite_com/index.php (including octoken, action, etc.) using POST, it triggers only one redirect in the browser and go (for example) to the new ad created page. However, with the executable, it initiates infinite redirects and creates an infinite number of copies of the submitted ad.

I believe the issue may be related to the token not changing. Have you observed this behavior?

*

MB Themes

Re: Hard bug items unlimited added
« Reply #1 on: November 09, 2023, 09:12:03 PM »
Token is not changing with each page load, but I've never seen such behaviour yet. 1 call should be 1 item.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Maximiliano

  • *
  • 3 posts
Re: Hard bug items unlimited added
« Reply #2 on: November 09, 2023, 10:09:15 PM »
Found the problem, a conflict with a change that was not present in the original script. I'll do some more tests and see if the problem recurs.

*

Maximiliano

  • *
  • 3 posts
Re: Hard bug items unlimited added
« Reply #3 on: November 09, 2023, 10:58:23 PM »
Ok, the problem occurs when "Redirect priority after publish" CATEGORY is chosen with value="".

LINE 181  item.php


          // 420 redirect after publish
          $redirect_type = osc_get_redirect_after_publish();

          if($redirect_type == 'DASH-ITEM-CAT') {
            if(osc_is_web_user_logged_in()) {
              $this->redirectTo(osc_user_list_items_url());
              exit;
            }

            if($success != 1) {
              $this->redirectTo(osc_item_url_ns($itemId));
              exit;
            }

            $this->redirectTo(osc_search_category_url());
            exit;
          }

          if($redirect_type == 'ITEM-CAT') {
            if($success != 1) {
              $this->redirectTo(osc_item_url_ns($itemId));
              exit;
            }

            $this->redirectTo(osc_search_category_url());
            exit;
          }

          $this->redirectTo(osc_search_category_url());  ---> HERE THE PROBLEM
          exit;
        }
        break;

*

MB Themes

Re: Hard bug items unlimited added
« Reply #4 on: November 10, 2023, 08:32:05 AM »
It's valid & functional code, I do not see any problem there.
There will be small update in Osclass 8.2.0 for osc_search_category_url() function that will handle also category ID = 0
« Last Edit: November 10, 2023, 09:05:13 AM by MB Themes »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots