PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
← All changes | src/DonationSpam/Akismet/DataTransferObjects/CommentCheckArgs.php +4 -3 4.15.1 → 4.17.0 View file →
@@ -20,8 +20,9 @@
20 20 public $comment_author;
21 21 public $comment_author_email;
22 22
23 23 /**
24 + * @since 4.16.0 handle undefined server variables gracefully
24 25 * @since 3.22.0 updated params to receive
25 26 * @since 3.15.0
26 27 */
27 28 public static function make(string $comment, string $email, string $firstName): CommentCheckArgs
@@ -36,11 +37,11 @@
36 37 $self->blog = get_option('home');
37 38 $self->blog_lang = get_locale();
38 39 $self->blog_charset = get_option('blog_charset');
39 40
40 - $self->user_ip = @$_SERVER['REMOTE_ADDR'];
41 - $self->user_agent = @$_SERVER['HTTP_USER_AGENT'];
42 - $self->referrer = @$_SERVER['HTTP_REFERER'];
41 + $self->user_ip = $_SERVER['REMOTE_ADDR'] ?? '';
42 + $self->user_agent = $_SERVER['HTTP_USER_AGENT'] ?? '';
43 + $self->referrer = $_SERVER['HTTP_REFERER'] ?? '';
43 44
44 45 // Append additional server variables.
45 46 foreach ( $_SERVER as $key => $value ) {
46 47 if ( ! in_array( $key, [ 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' ], true ) ) {