r62632 - in /branches/upstream/libnet-opensrs-perl/current: Changes META.yml lib/Net/OpenSRS.pm
ivan at users.alioth.debian.org
ivan at users.alioth.debian.org
Thu Sep 16 17:11:26 UTC 2010
Author: ivan
Date: Thu Sep 16 17:11:00 2010
New Revision: 62632
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62632
Log:
[svn-upgrade] new version libnet-opensrs-perl (0.06)
Modified:
branches/upstream/libnet-opensrs-perl/current/Changes
branches/upstream/libnet-opensrs-perl/current/META.yml
branches/upstream/libnet-opensrs-perl/current/lib/Net/OpenSRS.pm
Modified: branches/upstream/libnet-opensrs-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-opensrs-perl/current/Changes?rev=62632&op=diff
==============================================================================
--- branches/upstream/libnet-opensrs-perl/current/Changes (original)
+++ branches/upstream/libnet-opensrs-perl/current/Changes Thu Sep 16 17:11:00 2010
@@ -15,3 +15,7 @@
0.05 Sun Jun 27 16:54:23 EDT 2010
- Correct de-nastification to handle single item dt_assoc
(eg belongs_to_rsp response)
+
+0.06 Thu Sep 16 00:21:06 EDT 2010
+ - escape the XML special characters
+
Modified: branches/upstream/libnet-opensrs-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-opensrs-perl/current/META.yml?rev=62632&op=diff
==============================================================================
--- branches/upstream/libnet-opensrs-perl/current/META.yml (original)
+++ branches/upstream/libnet-opensrs-perl/current/META.yml Thu Sep 16 17:11:00 2010
@@ -1,26 +1,18 @@
--- #YAML:1.0
-name: Net-OpenSRS
-version: 0.05
-abstract: Domain registration via the Tucows OpenSRS HTTPS XML API
-author:
+name: Net-OpenSRS
+version: 0.06
+abstract: Domain registration via the Tucows OpenSRS HTTPS XML API
+license: ~
+author:
- Richard L. Siddall <opensrs at elirion.net>
-license: unknown
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
-build_requires:
- ExtUtils::MakeMaker: 0
-requires:
- Date::Calc: 0
- Digest::MD5: 0
- LWP::UserAgent: 0
- Test::More: 0
- XML::Simple: 0
-no_index:
- directory:
- - t
- - inc
-generated_by: ExtUtils::MakeMaker version 6.56
+generated_by: ExtUtils::MakeMaker version 6.42
+distribution_type: module
+requires:
+ Date::Calc: 0
+ Digest::MD5: 0
+ LWP::UserAgent: 0
+ Test::More: 0
+ XML::Simple: 0
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
Modified: branches/upstream/libnet-opensrs-perl/current/lib/Net/OpenSRS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-opensrs-perl/current/lib/Net/OpenSRS.pm?rev=62632&op=diff
==============================================================================
--- branches/upstream/libnet-opensrs-perl/current/lib/Net/OpenSRS.pm (original)
+++ branches/upstream/libnet-opensrs-perl/current/lib/Net/OpenSRS.pm Thu Sep 16 17:11:00 2010
@@ -150,7 +150,7 @@
use Digest::MD5;
use Date::Calc qw/ Add_Delta_Days Today This_Year /;
-our $VERSION = '0.05';
+our $VERSION = '0.06';
my $rv;
*hash = \&Digest::MD5::md5_hex;
@@ -1194,6 +1194,24 @@
return $self->last_response(1);
}
+# encode special characters
+
+my %encode_hash = (
+ '<' => '<',
+ '>' => '>',
+ "'" => ''',
+ '"' => '"',
+ '&' => '&',
+);
+
+sub _encode
+{
+ my $arg = shift;
+ return $arg unless ($arg =~/\<|\>|\'|\"|\&/);
+ $arg =~ s/(\<|\>|\'|\"|\&)/$encode_hash{$1}/ge;
+ $arg
+}
+
# format perl structs into opensrs XML
sub _format
{
@@ -1207,7 +1225,7 @@
my $c = 0;
$xml .= "$sp<item key=\"$_\">\n";
$xml .= "$sp <dt_array>\n";
- foreach (sort @$val) {
+ foreach (map { _encode($_) } sort @$val) {
$xml .= "$sp <item key=\"$c\">$_</item>\n";
$c++;
}
@@ -1226,6 +1244,7 @@
}
else {
+ $val = _encode($val);
$xml .= "$sp<item key=\"$_\">$val</item>\n";
}
More information about the Pkg-perl-cvs-commits
mailing list