GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: GNU/Weeb Mailing List <[email protected]>
Cc: Ammar Faizi <[email protected]>,
	Michael William Jonathan <[email protected]>,
	Nicholas Rosenberg <[email protected]>,
	GNU/Weeb Facebook Team <[email protected]>,
	VNLX Kernel Department <[email protected]>
Subject: [PATCH fb v1 1/3] fb: Fix `getCache()` expiration logic handling
Date: Thu, 29 Jun 2023 02:58:26 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

The getCache() function doesn't take the expiration date into account.
Make sure it does.

Fixes: 88952f396b1b4831eab3b8ed5d71959e42686a88 ("fb: Introduce `getCache()` and `setCache()` functions")
Signed-off-by: Ammar Faizi <[email protected]>
---
 src/Facebook/Facebook.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/Facebook/Facebook.php b/src/Facebook/Facebook.php
index 00aed812693248a8..6afd735ca4aa6bca 100644
--- a/src/Facebook/Facebook.php
+++ b/src/Facebook/Facebook.php
@@ -306,6 +306,11 @@ class Facebook
 			return NULL;
 		}
 
+		if ($data["exp"] < time()) {
+			unlink($file);
+			return NULL;
+		}
+
 		return $data["data"];
 	}
 
-- 
Ammar Faizi


  reply	other threads:[~2023-06-28 19:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28 19:58 [PATCH fb v1 0/3] A small bug fix for the mbasic changes Ammar Faizi
2023-06-28 19:58 ` Ammar Faizi [this message]
2023-06-28 19:58 ` [PATCH fb v1 2/3] fb: .gitignore: Ignore *.patch files Ammar Faizi
2023-06-28 19:58 ` [PATCH fb v1 3/3] fb: Post: Fix the wrong content type detection (photo issue) Ammar Faizi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox