Skip Menu |

This queue is for tickets about the Flickr-API CPAN distribution.

Report information
The Basics
Id: 60353
Status: resolved
Priority: 0/
Queue: Flickr-API

People
Owner: Nobody in particular
Requestors: SSEVERIN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.04
Fixed in: (no value)



Subject: Failure with UTF-8 encoded data (with patch)
The symptom is this error: Wide character in subroutine entry at [...]/Flickr/API.pm line 48. The problem is in the computation of the hash for the arguments in sub sign_args. A simple fix, suggested by the Digest::MD5 docs, worked for me and is attached. -Steve
Subject: flickr_api_encode_utf8.patch
--- API.pm.orig 2010-08-14 21:33:05.000000000 -0500 +++ API.pm 2010-08-14 21:33:08.000000000 -0500 @@ -7,6 +7,7 @@ use XML::Parser::Lite::Tree; use Flickr::API::Request; use Flickr::API::Response; use Digest::MD5 qw(md5_hex); +use Encode qw(encode_utf8); our @ISA = qw(LWP::UserAgent); @@ -45,7 +46,7 @@ sub sign_args { $sig .= $key . $value; } - return md5_hex($sig); + return md5_hex(encode_utf8($sig)); } sub request_auth_url {
Subject: [rt.cpan.org #60353]
Date: Thu, 23 May 2013 13:58:44 +0000
To: "bug-Flickr-API [...] rt.cpan.org" <bug-Flickr-API [...] rt.cpan.org>
From: Sascha Schmidt <sascha [...] schmidt.ps>
This issue still exists within version 1.06. The supplied fix (patch) resolves the encoding bug... (Cannot create photosets with special characters). Please commit this patch to upstream. Thanks
RT-Send-CC: sascha [...] schmidt.ps
That patch only fixes the signing, and does not change to data being sent (so the signature is invalid). This patch also changes the encoding of the post params, so that valid signatures will be generated: https://github.com/iamcal/perl-Flickr-API/commit/00a0f6c5eef49147750457acca03929ea922edae To enable this new mode, pass unicode=>1 to the constructor. This is required since the old usage (passing raw utf8 bytes) is not compatible. See the added tests for an example of equivalent usage in both modes. This version has been uploaded to CPAN as 1.07