Code Duplication    Length = 12-12 lines in 2 locations

admin/gateways/pec24/nusoap.php 2 locations

@@ 4619-4630 (lines=12) @@
4616
4617
            return false;
4618
        }
4619
        if (strpos($headers['content-type'], '=')) {
4620
            $enc = str_replace('"', '', substr(strstr($headers['content-type'], '='), 1));
4621
            $this->debug('Got response encoding: ' . $enc);
4622
            if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
4623
                $this->xml_encoding = strtoupper($enc);
4624
            } else {
4625
                $this->xml_encoding = 'US-ASCII';
4626
            }
4627
        } else {
4628
            // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
4629
            $this->xml_encoding = 'ISO-8859-1';
4630
        }
4631
        $this->debug('Use encoding: ' . $this->xml_encoding . ' when creating nusoap_parser');
4632
        // parse response, get soap parser obj
4633
        $parser = new nusoap_parser($data, $this->xml_encoding, '', $this->decode_utf8);
@@ 8160-8171 (lines=12) @@
8157
8158
            return false;
8159
        }
8160
        if (strpos($headers['content-type'], '=')) {
8161
            $enc = str_replace('"', '', substr(strstr($headers['content-type'], '='), 1));
8162
            $this->debug('Got response encoding: ' . $enc);
8163
            if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
8164
                $this->xml_encoding = strtoupper($enc);
8165
            } else {
8166
                $this->xml_encoding = 'US-ASCII';
8167
            }
8168
        } else {
8169
            // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
8170
            $this->xml_encoding = 'ISO-8859-1';
8171
        }
8172
        $this->debug('Use encoding: ' . $this->xml_encoding . ' when creating nusoap_parser');
8173
        $parser = new nusoap_parser($data, $this->xml_encoding, $this->operation, $this->decode_utf8);
8174
        // add parser debug data to our debug