Code Duplication    Length = 22-22 lines in 2 locations

admin/gateways/pec24/nusoap.php 2 locations

@@ 4095-4116 (lines=22) @@
4092
                } else {
4093
                    $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k)));
4094
                }
4095
                if ($k === 'soapaction') {
4096
                    // get SOAPAction header
4097
                    $k                = 'SOAPAction';
4098
                    $v                = str_replace('"', '', $v);
4099
                    $v                = str_replace('\\', '', $v);
4100
                    $this->SOAPAction = $v;
4101
                } elseif ($k === 'content-type') {
4102
                    // get the character encoding of the incoming request
4103
                    if (strpos($v, '=')) {
4104
                        $enc = substr(strstr($v, '='), 1);
4105
                        $enc = str_replace('"', '', $enc);
4106
                        $enc = str_replace('\\', '', $enc);
4107
                        if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
4108
                            $this->xml_encoding = strtoupper($enc);
4109
                        } else {
4110
                            $this->xml_encoding = 'US-ASCII';
4111
                        }
4112
                    } else {
4113
                        // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
4114
                        $this->xml_encoding = 'ISO-8859-1';
4115
                    }
4116
                }
4117
                $this->headers[$k] = $v;
4118
                $this->request     .= "$k: $v\r\n";
4119
                $this->debug("$k: $v");
@@ 4131-4152 (lines=22) @@
4128
                    $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k)));
4129
                    $k = strtolower($k);
4130
                }
4131
                if ($k === 'soapaction') {
4132
                    // get SOAPAction header
4133
                    $k                = 'SOAPAction';
4134
                    $v                = str_replace('"', '', $v);
4135
                    $v                = str_replace('\\', '', $v);
4136
                    $this->SOAPAction = $v;
4137
                } elseif ($k === 'content-type') {
4138
                    // get the character encoding of the incoming request
4139
                    if (strpos($v, '=')) {
4140
                        $enc = substr(strstr($v, '='), 1);
4141
                        $enc = str_replace('"', '', $enc);
4142
                        $enc = str_replace('\\', '', $enc);
4143
                        if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
4144
                            $this->xml_encoding = strtoupper($enc);
4145
                        } else {
4146
                            $this->xml_encoding = 'US-ASCII';
4147
                        }
4148
                    } else {
4149
                        // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
4150
                        $this->xml_encoding = 'ISO-8859-1';
4151
                    }
4152
                }
4153
                $this->headers[$k] = $v;
4154
                $this->request     .= "$k: $v\r\n";
4155
                $this->debug("$k: $v");