Code Duplication    Length = 10-12 lines in 3 locations

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

@@ 699-710 (lines=12) @@
696
            //normal mode: get ticket and remove it from CGI parameters for developpers
697
            $ticket = (isset($_GET['ticket']) ? $_GET['ticket'] : null);
698
            switch ($this->getServerVersion()) {
699
                case CAS_VERSION_1_0: // check for a Service Ticket
700
                    if (preg_match('/^ST-/', $ticket)) {
701
                        phpCAS::trace('ST \'' . $ticket . '\' found');
702
                        //ST present
703
                        $this->setST($ticket);
704
                        //ticket has been taken into account, unset it to hide it to applications
705
                        unset($_GET['ticket']);
706
                    } else {
707
                        if (!empty($ticket)) {
708
                            //ill-formed ticket, halt
709
                            phpCAS::error('ill-formed ticket found in the URL (ticket=`' . htmlentities($ticket) . '\')');
710
                        }
711
                    }
712
                    break;
713
                case CAS_VERSION_2_0: // check for a Service or Proxy Ticket
@@ 713-722 (lines=10) @@
710
                        }
711
                    }
712
                    break;
713
                case CAS_VERSION_2_0: // check for a Service or Proxy Ticket
714
                    if (preg_match('/^[SP]T-/', $ticket)) {
715
                        phpCAS::trace('ST or PT \'' . $ticket . '\' found');
716
                        $this->setPT($ticket);
717
                        unset($_GET['ticket']);
718
                    } else {
719
                        if (!empty($ticket)) {
720
                            //ill-formed ticket, halt
721
                            phpCAS::error('ill-formed ticket found in the URL (ticket=`' . htmlentities($ticket) . '\')');
722
                        }
723
                    }
724
                    break;
725
                case SAML_VERSION_1_1: // SAML just does Service Tickets
@@ 725-734 (lines=10) @@
722
                        }
723
                    }
724
                    break;
725
                case SAML_VERSION_1_1: // SAML just does Service Tickets
726
                    if (preg_match('/^[SP]T-/', $ticket)) {
727
                        phpCAS::trace('SA \'' . $ticket . '\' found');
728
                        $this->setSA($ticket);
729
                        unset($_GET['ticket']);
730
                    } else {
731
                        if (!empty($ticket)) {
732
                            //ill-formed ticket, halt
733
                            phpCAS::error('ill-formed ticket found in the URL (ticket=`' . htmlentities($ticket) . '\')');
734
                        }
735
                    }
736
                    break;
737
            }