--- a/web/lib/Zend/Service/Amazon/Authentication/S3.php Thu Mar 21 17:31:31 2013 +0100
+++ b/web/lib/Zend/Service/Amazon/Authentication/S3.php Thu Mar 21 19:50:53 2013 +0100
@@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Service_Amazon
* @subpackage Authentication
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@@ -34,7 +34,7 @@
* @category Zend
* @package Zend_Service_Amazon
* @subpackage Authentication
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Service_Amazon_Authentication_S3 extends Zend_Service_Amazon_Authentication
@@ -52,9 +52,9 @@
if (! is_array($headers)) {
$headers = array($headers);
}
-
+
$type = $md5 = $date = '';
-
+
// Search for the Content-type, Content-MD5 and Date headers
foreach ($headers as $key => $val) {
if (strcasecmp($key, 'content-type') == 0) {
@@ -65,12 +65,12 @@
$date = $val;
}
}
-
+
// If we have an x-amz-date header, use that instead of the normal Date
if (isset($headers['x-amz-date']) && isset($date)) {
$date = '';
}
-
+
$sig_str = "$method\n$md5\n$type\n$date\n";
// For x-amz- headers, combine like keys, lowercase them, sort them
@@ -92,18 +92,18 @@
$sig_str .= $key . ':' . implode(',', $val) . "\n";
}
}
-
+
$sig_str .= '/'.parse_url($path, PHP_URL_PATH);
if (strpos($path, '?location') !== false) {
$sig_str .= '?location';
- } else
+ } else
if (strpos($path, '?acl') !== false) {
$sig_str .= '?acl';
- } else
+ } else
if (strpos($path, '?torrent') !== false) {
$sig_str .= '?torrent';
}
-
+
$signature = base64_encode(Zend_Crypt_Hmac::compute($this->_secretKey, 'sha1', utf8_encode($sig_str), Zend_Crypt_Hmac::BINARY));
$headers['Authorization'] = 'AWS ' . $this->_accessKey . ':' . $signature;