Code Duplication    Length = 22-22 lines in 2 locations

admin/gateways/pec24/nusoap.php 2 locations

@@ 3868-3889 (lines=22) @@
3865
                } else {
3866
                    $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k)));
3867
                }
3868
                if ($k == 'soapaction') {
3869
                    // get SOAPAction header
3870
                    $k = 'SOAPAction';
3871
                    $v = str_replace('"', '', $v);
3872
                    $v = str_replace('\\', '', $v);
3873
                    $this->SOAPAction = $v;
3874
                } else if ($k == 'content-type') {
3875
                    // get the character encoding of the incoming request
3876
                    if (strpos($v, '=')) {
3877
                        $enc = substr(strstr($v, '='), 1);
3878
                        $enc = str_replace('"', '', $enc);
3879
                        $enc = str_replace('\\', '', $enc);
3880
                        if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)) {
3881
                            $this->xml_encoding = strtoupper($enc);
3882
                        } else {
3883
                            $this->xml_encoding = 'US-ASCII';
3884
                        }
3885
                    } else {
3886
                        // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
3887
                        $this->xml_encoding = 'ISO-8859-1';
3888
                    }
3889
                }
3890
                $this->headers[$k] = $v;
3891
                $this->request .= "$k: $v\r\n";
3892
                $this->debug("$k: $v");
@@ 3902-3923 (lines=22) @@
3899
                } else {
3900
                    $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k)));                                             $k = strtolower($k);
3901
                }
3902
                if ($k == 'soapaction') {
3903
                    // get SOAPAction header
3904
                    $k = 'SOAPAction';
3905
                    $v = str_replace('"', '', $v);
3906
                    $v = str_replace('\\', '', $v);
3907
                    $this->SOAPAction = $v;
3908
                } else if ($k == 'content-type') {
3909
                    // get the character encoding of the incoming request
3910
                    if (strpos($v, '=')) {
3911
                        $enc = substr(strstr($v, '='), 1);
3912
                        $enc = str_replace('"', '', $enc);
3913
                        $enc = str_replace('\\', '', $enc);
3914
                        if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)) {
3915
                            $this->xml_encoding = strtoupper($enc);
3916
                        } else {
3917
                            $this->xml_encoding = 'US-ASCII';
3918
                        }
3919
                    } else {
3920
                        // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
3921
                        $this->xml_encoding = 'ISO-8859-1';
3922
                    }
3923
                }
3924
                $this->headers[$k] = $v;
3925
                $this->request .= "$k: $v\r\n";
3926
                $this->debug("$k: $v");