File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
gwynethllewelyn/postlocalstorage Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public function check_expiry_time($event)
8181 try
8282 {
8383 /**
84- * Session length, as defined on the configuration parameters.
84+ * Session length, as defined on the configuration parameters, in seconds .
8585 * If it doesn't exist, or throws an error, we'll set it to zero and that's it.
8686 *
8787 * @var int
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class ext extends base
2828 */
2929 public function is_enableable ()
3030 {
31- error_log ('[phpBB3 postlocalstorage] my is_enableable() was called! ' );
31+ // error_log('[phpBB3 postlocalstorage] my is_enableable() was called!');
3232 return phpbb_version_compare (PHPBB_VERSION , '3.3 ' , '>= ' );
3333 }
3434}
Original file line number Diff line number Diff line change 176176 function ( ) {
177177 /**
178178 * Retrieve the session expiry time that was stamped on the post submit page.
179+ * Force it to a number!
180+ *
179181 * @type {number }
180182 */
181- const expiry_time = document . getElementById ( 'expiry-time' ) . innerText . trim ( ) ;
182- const dateNow = Date . now ( ) ;
183- console . debug ( "Date.now() is " + dateNow + " and expiry_time is " + expiry_time ) ;
183+ const expiry_time = parseInt ( document . getElementById ( 'expiry-time' ) . innerText . trim ( ) , 10 ) ;
184+ const dateNow = Math . floor ( Date . now ( ) / 1000 ) ; // we get milliseconds, so we need to convert to seconds.
185+ console . debug ( "Date.now() in seconds is " + dateNow + " and expiry_time is " + expiry_time ) ;
184186 if ( dateNow > expiry_time ) {
185187 // We won't clear anything if the session already expired, so return.
186188 return ;
You can’t perform that action at this time.
0 commit comments