tgknight - 2006-01-31

Hello, I have noticed that when a website uses a header redirect back to the same URL after you submit a form, that Snoopy goes into a loop trying to submit the form vars over and over, until you reach the maxredirs variable.

Here is my modification to fix this problem, starts around line 326 in the submit method.

Any comments or improvements?

I hope that this can be added to the standard library.



/* follow the redirect */                $this->_redirectdepth++;
if( strpos( $this->_redirectaddr, "?" ) > 0 || $this->_redirectaddr == $this->lastredirectaddr) {

$this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get
                            } else {

$this->submit($this->_redirectaddr,$formvars, $formfiles);