Code Duplication    Length = 22-22 lines in 2 locations

admin/gateways/pec24/nusoap.php 2 locations

@@ 4072-4093 (lines=22) @@
4069
                } else {
4070
                    $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k)));
4071
                }
4072
                if ($k === 'soapaction') {
4073
                    // get SOAPAction header
4074
                    $k                = 'SOAPAction';
4075
                    $v                = str_replace('"', '', $v);
4076
                    $v                = str_replace('\\', '', $v);
4077
                    $this->SOAPAction = $v;
4078
                } elseif ($k === 'content-type') {
4079
                    // get the character encoding of the incoming request
4080
                    if (strpos($v, '=')) {
4081
                        $enc = substr(strstr($v, '='), 1);
4082
                        $enc = str_replace('"', '', $enc);
4083
                        $enc = str_replace('\\', '', $enc);
4084
                        if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
4085
                            $this->xml_encoding = strtoupper($enc);
4086
                        } else {
4087
                            $this->xml_encoding = 'US-ASCII';
4088
                        }
4089
                    } else {
4090
                        // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
4091
                        $this->xml_encoding = 'ISO-8859-1';
4092
                    }
4093
                }
4094
                $this->headers[$k] = $v;
4095
                $this->request .= "$k: $v\r\n";
4096
                $this->debug("$k: $v");
@@ 4108-4129 (lines=22) @@
4105
                    $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k)));
4106
                    $k = strtolower($k);
4107
                }
4108
                if ($k === 'soapaction') {
4109
                    // get SOAPAction header
4110
                    $k                = 'SOAPAction';
4111
                    $v                = str_replace('"', '', $v);
4112
                    $v                = str_replace('\\', '', $v);
4113
                    $this->SOAPAction = $v;
4114
                } elseif ($k === 'content-type') {
4115
                    // get the character encoding of the incoming request
4116
                    if (strpos($v, '=')) {
4117
                        $enc = substr(strstr($v, '='), 1);
4118
                        $enc = str_replace('"', '', $enc);
4119
                        $enc = str_replace('\\', '', $enc);
4120
                        if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
4121
                            $this->xml_encoding = strtoupper($enc);
4122
                        } else {
4123
                            $this->xml_encoding = 'US-ASCII';
4124
                        }
4125
                    } else {
4126
                        // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
4127
                        $this->xml_encoding = 'ISO-8859-1';
4128
                    }
4129
                }
4130
                $this->headers[$k] = $v;
4131
                $this->request .= "$k: $v\r\n";
4132
                $this->debug("$k: $v");