From ef4365879413eab6a0d2be64374a9840c7eed804 Mon Sep 17 00:00:00 2001 From: Mohamed Mujahid Date: Fri, 23 Jul 2010 10:01:23 +0000 Subject: function replacements --- cdn/video_s3/includes/S3.php | 4 ++-- cdn/video_s3/includes/amazon_s3.inc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'cdn/video_s3') 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; } -- cgit v1.2.3