summaryrefslogtreecommitdiff
path: root/Postman/PostmanLogFields.php
diff options
context:
space:
mode:
Diffstat (limited to 'Postman/PostmanLogFields.php')
-rw-r--r--Postman/PostmanLogFields.php18
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