From 0f790e77b64d3d6547036240f643202b0596f5cc Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Mon, 1 Oct 2018 23:54:52 -0700 Subject: [PATCH] Ensure any code after a redirect is not executed --- examples/gmail_send_email.php | 1 + examples/google_plus_profile.php | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/gmail_send_email.php b/examples/gmail_send_email.php index 37fdd40..a2a3e7c 100644 --- a/examples/gmail_send_email.php +++ b/examples/gmail_send_email.php @@ -33,6 +33,7 @@ if (isset($_GET['code'])) { $_SESSION['access_token'] = $curl->response->access_token; header('Location: ?'); + exit; } elseif (!empty($_SESSION['access_token'])) { // Use the access token to send an email. $curl = new Curl(); diff --git a/examples/google_plus_profile.php b/examples/google_plus_profile.php index b8832d4..d3c0735 100644 --- a/examples/google_plus_profile.php +++ b/examples/google_plus_profile.php @@ -33,6 +33,7 @@ if (isset($_GET['code'])) { $_SESSION['access_token'] = $curl->response->access_token; header('Location: ?'); + exit; } elseif (!empty($_SESSION['access_token']) && !isset($_GET['retry'])) { // Use the access token to retrieve the profile. $curl = new Curl();