Code Duplication    Length = 5-7 lines in 2 locations

main/auth/cas/lib/CAS/client.php 2 locations

@@ 1805-1809 (lines=5) @@
1802
            } else {
1803
                $final_uri .= $_SERVER['HTTP_X_FORWARDED_SERVER'];
1804
            }
1805
            if (($this->isHttps() && $_SERVER['SERVER_PORT'] != 443)
1806
                || (!$this->isHttps() && $_SERVER['SERVER_PORT'] != 80)
1807
            ) {
1808
                $final_uri .= ':';
1809
                $final_uri .= $_SERVER['SERVER_PORT'];
1810
            }
1811
            $request_uri = $_SERVER['REQUEST_URI'];
1812
            $request_uri = preg_replace('/\?.*$/', '', $request_uri);
@@ 2655-2661 (lines=7) @@
2652
                $server_name = $_SERVER['HTTP_X_FORWARDED_SERVER'];
2653
            }
2654
            $final_uri .= $server_name;
2655
            if (!strpos($server_name, ':')) {
2656
                if (($this->isHttps() && $_SERVER['SERVER_PORT'] != 443)
2657
                    || (!$this->isHttps() && $_SERVER['SERVER_PORT'] != 80)
2658
                ) {
2659
                    $final_uri .= ':';
2660
                    $final_uri .= $_SERVER['SERVER_PORT'];
2661
                }
2662
            }
2663
2664
            $request_uri = explode('?', $_SERVER['REQUEST_URI'], 2);