From cb5d5b7603be910bb714cf7ed71ebe9bcf31246c Mon Sep 17 00:00:00 2001 From: Terence Eden Date: Wed, 17 Apr 2024 11:20:46 +0100 Subject: [PATCH] Follow redirects when getting data. Better CC checking --- index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 2d39a0f..08f95d0 100644 --- a/index.php +++ b/index.php @@ -336,7 +336,11 @@ // Has the user has been specifically CC'd? if ( isset( $inbox_message["cc"] ) ) { - $reply = in_array( "https://{$server}/{$username}", $inbox_message["cc"] ); + if ( is_array( $inbox_message["cc"] ) ) { + $reply = in_array( "https://{$server}/{$username}", $inbox_message["cc"] ); + } else { + $reply = ( "https://{$server}/{$username}" === $inbox_message["cc"] ); + } } else { $reply = false; } @@ -1256,6 +1260,7 @@ HTML; // Set cURL options $ch = curl_init( $url ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); + curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers ); curl_setopt( $ch, CURLOPT_USERAGENT, USERAGENT );