From fd90de595209fcc63155100e4e7dd594e4b8e14b Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 5 May 2017 16:47:50 -0400 Subject: [PATCH] if no AuthHashGEneratedAt then generate one instead of outputting an error --- web/ajax/stream.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/ajax/stream.php b/web/ajax/stream.php index 463558640..26318dd95 100644 --- a/web/ajax/stream.php +++ b/web/ajax/stream.php @@ -116,7 +116,7 @@ switch ( $data['type'] ) session_start(); $time = time(); // Regenerate auth hash after half the lifetime of the hash - if ( $_SESSION['AuthHashGeneratedAt'] < $time - (ZM_AUTH_HASH_TTL * 1800) ) { + if ( (!isset($_SESSION['AuthHashGeneratedAt'])) or ( $_SESSION['AuthHashGeneratedAt'] < $time - (ZM_AUTH_HASH_TTL * 1800) ) ) { $data['auth'] = generateAuthHash( ZM_AUTH_HASH_IPS ); } session_write_close(); @@ -134,7 +134,7 @@ switch ( $data['type'] ) session_start(); $time = time(); // Regenerate auth hash after half the lifetime of the hash - if ( $_SESSION['AuthHashGeneratedAt'] < $time - (ZM_AUTH_HASH_TTL * 1800) ) { + if ( (!isset($_SESSION['AuthHashGeneratedAt'])) or ( $_SESSION['AuthHashGeneratedAt'] < $time - (ZM_AUTH_HASH_TTL * 1800) ) ) { $data['auth'] = generateAuthHash( ZM_AUTH_HASH_IPS ); } session_write_close();