Zoom Media Gallery 2.5.1 RC4 Freezes or Crashes Apache2

After getting a little bit of time to research the new problem causing Apache2 to crash or freeze up and use 100% CPU utilization, I believe I have found at least part of the problem.

The Zoom Media Gallery 2.5.1 RC4 does not check to ensure that the Page Number is legit.  I kept checking the server-status on Apache and each of the times, I kept noticing that the website address including an address with a negative page number.  How could it be possible for a page number to be negative?  I don’t know, but ask Google!  Google keeps spidering the web sites here and many times has a negative page  number – which doesn’t make any sense.

To head off this issue, I inserted a few lines of code into the zoom.php file in the /components/com_zoom directory.  I created these lines directly under the:

//error reporting(E_ALL)

comment around line 34 – just before the:

// Create zOOm Image Gallery object

Here is the code to insert:

// Check to ensure the Page number is valid (not negative) or throw an error
$PageCheck = mosGetParam($_REQUEST,’PageNo’);
if ($PageCheck < 1 && isset($PageCheck)) {
     echo (‘Page number cannot be zero or negative.’);
     exit;
}

I am not 100% sure yet if this will fix all the problems with Zoom Media Gallery 2.5.1 RC4 and the 100% CPU utilization with Apache, but I know this will help curtail the problem.  When I tried to put the same URL that caused an Apache process to use 100% of the CPU into my web browser, it sat there until the five minute timeout period for scripts (I set a five minute, or 300 second timeout period in the php.ini file under max_execution_time).

I have completed all changes needed for this issue in my Downloads section.  You can simply download the full component there and install it as required.