summaryrefslogtreecommitdiff
path: root/lib/Net/Plesk/Response.pm
diff options
context:
space:
mode:
authorivan <ivan>2011-11-08 22:34:10 +0000
committerivan <ivan>2011-11-08 22:34:10 +0000
commit314150b68fad1ddff185850c9c97beb9d756dff0 (patch)
treeef2fb60e1e91bb89246ed09f0d20477e4b1cea86 /lib/Net/Plesk/Response.pm
parent20887ceb08f6bf11e3492f4ef3515f1de1ffeb50 (diff)
handle responses with an encoding= (though not actually the encoding)HEADmaster
Diffstat (limited to 'lib/Net/Plesk/Response.pm')
-rw-r--r--lib/Net/Plesk/Response.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Net/Plesk/Response.pm b/lib/Net/Plesk/Response.pm
index 53342d5..6b9a46e 100644
--- a/lib/Net/Plesk/Response.pm
+++ b/lib/Net/Plesk/Response.pm
@@ -37,9 +37,11 @@ sub new {
my $self = {};
bless($self, $class);
+ my $encoding = ''; #default
my $data = shift;
- if ($data =~ /^\<\?xml version=\"1.0\"\?\>(.*)$/s){
- $data=$1;
+ if ($data =~ /^\<\?xml version=\"1.0\"(\s+encoding="([\w\-]*)")?\?\>(.*)$/s){
+ $encoding = $2; #don't actually do anything with this yet
+ $data = $3;
}else{
$data =~ s/[^\w\s]/ /g; # yes, we lose stuff
$data = '<?xml version="1.0"?>' .