-
-
Save davecranwell/2251080 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git webform_protected_downloads.module webform_protected_downloads.module | |
index bf9a728..36c6889 100644 | |
--- webform_protected_downloads.module | |
+++ webform_protected_downloads.module | |
@@ -461,7 +461,7 @@ function webform_protected_downloads_file_user_has_access($nid, $fid) { | |
unset($_SESSION[WEBFORM_PROTECTED_DOWNLOADS_SESSION_KEY][$row->hash]); | |
$ok = FALSE; | |
} | |
- } else { | |
+ } else {/ | |
$ok = FALSE; | |
} | |
$ok = $ok && ($row->expires == 0 || $row->expires > time()); | |
@@ -578,7 +578,7 @@ function webform_protected_downloads_process_submissions($form, &$form_state) { | |
// create hash, calculate expiration timestamp | |
$hash = webform_protected_downloads_create_hash(); | |
$processed = time(); | |
- $expires = $processed + $conf->expiration_download; | |
+ $expires = $conf->expiration_download == 0 ? 0 : $processed + $conf->expiration_download; | |
// we need to save before sending the mail | |
$record = array( | |
diff --git webform_protected_downloads.page.inc webform_protected_downloads.page.inc | |
index 2a1ff09..b52536a 100644 | |
--- webform_protected_downloads.page.inc | |
+++ webform_protected_downloads.page.inc | |
@@ -164,7 +164,7 @@ function webform_protected_downloads_hash_is_valid($hash) { | |
} | |
else { | |
// otherwise we grant access if the hash has not yet expired | |
- return $access->expires > time(); | |
+ return ($access->expires == 0) || $access->expires > time(); | |
} | |
return FALSE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment