Code Duplication    Length = 21-21 lines in 2 locations

htdocs/class/snoopy.php 2 locations

@@ 281-301 (lines=21) @@
278
279
                    $this->_disconnect($fp);
280
281
                    if ($this->_redirectaddr) {
282
                        /* url was redirected, check if we've hit the max depth */
283
                        if ($this->maxredirs > $this->_redirectdepth) {
284
                            if (!preg_match("|^" . $URI_PARTS["scheme"] . "://|", $this->_redirectaddr))
285
                                $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr, $URI_PARTS["scheme"] . "://" . $URI_PARTS["host"]);
286
287
                            // only follow redirect if it's on this site, or offsiteok is true
288
                            if (preg_match("|^http://" . preg_quote($this->host) . "|i", $this->_redirectaddr) || $this->offsiteok) {
289
                                /* follow the redirect */
290
                                $this->_redirectdepth++;
291
                                $this->lastredirectaddr = $this->_redirectaddr;
292
                                if (strpos($this->_redirectaddr, "?") > 0)
293
                                    $this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get
294
                                else
295
                                    $this->submit($this->_redirectaddr, $formvars, $formfiles);
296
                            }
297
                        }
298
                    }
299
300
                    if ($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) {
301
                        $frameurls = $this->_frameurls;
302
                        $this->_frameurls = array();
303
304
                        while (list(, $frameurl) = each($frameurls)) {
@@ 336-356 (lines=21) @@
333
                    $this->_httpsrequest($path, $URI, $this->_submit_method, $this->_submit_type, $postdata);
334
                }
335
336
                if ($this->_redirectaddr) {
337
                    /* url was redirected, check if we've hit the max depth */
338
                    if ($this->maxredirs > $this->_redirectdepth) {
339
                        if (!preg_match("|^" . $URI_PARTS["scheme"] . "://|", $this->_redirectaddr))
340
                            $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr, $URI_PARTS["scheme"] . "://" . $URI_PARTS["host"]);
341
342
                        // only follow redirect if it's on this site, or offsiteok is true
343
                        if (preg_match("|^http://" . preg_quote($this->host) . "|i", $this->_redirectaddr) || $this->offsiteok) {
344
                            /* follow the redirect */
345
                            $this->_redirectdepth++;
346
                            $this->lastredirectaddr = $this->_redirectaddr;
347
                            if (strpos($this->_redirectaddr, "?") > 0)
348
                                $this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get
349
                            else
350
                                $this->submit($this->_redirectaddr, $formvars, $formfiles);
351
                        }
352
                    }
353
                }
354
355
                if ($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) {
356
                    $frameurls = $this->_frameurls;
357
                    $this->_frameurls = array();
358
359
                    while (list(, $frameurl) = each($frameurls)) {