Page 1 of 1

Infinite recursion on VM3.4.2 (Virtuemart bug)

PostPosted: Fri Oct 12, 2018 10:48 am
by admin
Hello friends, we just discovered a possible memory leak and infinite recursion bug on VM3.4.2 when handling 404 category pages in some cases.

we must had adjusted:
\components\com_virtuemart\views\category\view.html.php

original code:
Code: Select all
//No redirect here, for category id = 0 means show ALL categories! note by Max Milbers
      if ((!empty($this->categoryId) and $this->categoryId!==-1 ) and (empty($category->slug) or !$category->published)) {
          $this->handle404();
      }


with:
Code: Select all
//No redirect here, for category id = 0 means show ALL categories! note by Max Milbers
      if ((!empty($this->categoryId) and $this->categoryId!==-1 ) and (empty($category->slug) or !$category->published)) {
         static $wasHere;
         if (empty($wasHere)) {
          $wasHere = true;
          $this->handle404();
         }
      }


now the page simply says:
Category not found

which is better then waisting all available RAM of the server due to this.

best regards, stan