aboutsummaryrefslogtreecommitdiff
path: root/cdn
diff options
context:
space:
mode:
authorMohamed Mujahid <muja_dd@494418.no-reply.drupal.org>2010-07-23 10:01:23 +0000
committerMohamed Mujahid <muja_dd@494418.no-reply.drupal.org>2010-07-23 10:01:23 +0000
commitef4365879413eab6a0d2be64374a9840c7eed804 (patch)
treef32097751575177f2245b68b412f55cd95cbc70a /cdn
parente8f0a0d58a73a0d3e5877d9cd433e5c191fd93d2 (diff)
downloadvideo-ef4365879413eab6a0d2be64374a9840c7eed804.tar.gz
video-ef4365879413eab6a0d2be64374a9840c7eed804.tar.bz2
function replacements
Diffstat (limited to 'cdn')
-rw-r--r--cdn/video_s3/includes/S3.php4
-rw-r--r--cdn/video_s3/includes/amazon_s3.inc2
2 files changed, 3 insertions, 3 deletions
diff --git a/cdn/video_s3/includes/S3.php b/cdn/video_s3/includes/S3.php
index 70d3ad8..77af0f6 100644
--- a/cdn/video_s3/includes/S3.php
+++ b/cdn/video_s3/includes/S3.php
@@ -749,7 +749,7 @@ class S3 {
* @return string
*/
public static function getAuthenticatedURL($bucket, $uri, $lifetime, $hostBucket = false, $https = false) {
- $expires = time() + $lifetime;
+ $expires = REQUEST_TIME + $lifetime;
$uri = str_replace('%2F', '/', rawurlencode($uri)); // URI should be encoded (thanks Sean O'Dea)
return sprintf(($https ? 'https' : 'http').'://%s/%s?AWSAccessKeyId=%s&Expires=%u&Signature=%s',
$hostBucket ? $bucket : $bucket.'.s3.amazonaws.com', $uri, self::$__accessKey, $expires,
@@ -773,7 +773,7 @@ class S3 {
public static function getHttpUploadPostParams($bucket, $uriPrefix = '', $acl = self::ACL_PRIVATE, $lifetime = 3600, $maxFileSize = 5242880, $successRedirect = "201", $amzHeaders = array(), $headers = array(), $flashVars = false) {
// Create policy object
$policy = new stdClass;
- $policy->expiration = gmdate('Y-m-d\TH:i:s\Z', (time() + $lifetime));
+ $policy->expiration = gmdate('Y-m-d\TH:i:s\Z', (REQUEST_TIME + $lifetime));
$policy->conditions = array();
$obj = new stdClass; $obj->bucket = $bucket; array_push($policy->conditions, $obj);
$obj = new stdClass; $obj->acl = $acl; array_push($policy->conditions, $obj);
diff --git a/cdn/video_s3/includes/amazon_s3.inc b/cdn/video_s3/includes/amazon_s3.inc
index 53f5ff9..f53b087 100644
--- a/cdn/video_s3/includes/amazon_s3.inc
+++ b/cdn/video_s3/includes/amazon_s3.inc
@@ -69,7 +69,7 @@ class video_amazon_s3 {
*/
public function update($video) {
$result = db_query("UPDATE {video_s3} SET bucket='%s', filename='%s', filepath='%s', filemime='%s', filesize='%s', status=%d, completed=%d WHERE vid=%d",
- $video->bucket, $video->filename, $video->filepath, $video->filemime, $video->filesize, VIDEO_S3_ACTIVE, time(), $video->vid);
+ $video->bucket, $video->filename, $video->filepath, $video->filemime, $video->filesize, VIDEO_S3_ACTIVE, REQUEST_TIME, $video->vid);
return $result;
}