diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-09-13 11:29:33 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-09-13 11:29:33 +0000 |
commit | caa73945f9fe69875171ea2aade2c53e60b21bbe (patch) | |
tree | dbcc35d42a519d3796c82c3942891226a425c2e7 /Postman/PostmanLogFields.php | |
parent | 5f134fb5839bf3e161385727c2a2009b54444878 (diff) | |
download | Post-SMTP-caa73945f9fe69875171ea2aade2c53e60b21bbe.zip |
hooks + sanitize bug
Diffstat (limited to 'Postman/PostmanLogFields.php')
-rw-r--r-- | Postman/PostmanLogFields.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Postman/PostmanLogFields.php b/Postman/PostmanLogFields.php index 84a3121..6e04b8d 100644 --- a/Postman/PostmanLogFields.php +++ b/Postman/PostmanLogFields.php @@ -3,11 +3,11 @@ class PostmanLogFields { private $fields = array( 'success' => 'sanitize_text_field', - 'from_header' => 'sanitize_text_field', - 'to_header' => 'sanitize_text_field', - 'cc_header' => 'sanitize_text_field', - 'bcc_header' => 'sanitize_text_field', - 'reply_to_header' => 'sanitize_text_field', + 'from_header' => '', + 'to_header' => '', + 'cc_header' => '', + 'bcc_header' => '', + 'reply_to_header' => '', 'transport_uri' => 'sanitize_text_field', 'original_to' => 'sanitize_text_field', 'original_subject' => 'sanitize_text_field', @@ -75,7 +75,11 @@ class PostmanLogFields { private function sanitize( $key, $value ) { $callback = is_array( $value ) ? 'array_map' : 'call_user_func'; - return $callback( $this->fields[$key], $value ); + if ( ! empty( $this->fields[$key] ) ) { + return $callback( $this->fields[$key], $value ); + } + + return filter_var( $value, FILTER_SANITIZE_STRING | FILTER_SANITIZE_SPECIAL_CHARS ); } private function sanitize_message( $message ) { @@ -92,4 +96,4 @@ class PostmanLogFields { return $value; } -} +}
\ No newline at end of file |