summaryrefslogtreecommitdiff
path: root/Postman/PostmanInputSanitizer.php
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-08-26 13:21:06 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-08-26 13:21:06 +0000
commitaeb5cf0276bb7b658997281ba34abf6e69fe17bb (patch)
tree16a8f22e32115fced2607535ae99613fe2e6fa14 /Postman/PostmanInputSanitizer.php
parent59be4e796441e494f25b18ece7438dbf02442e47 (diff)
downloadPost-SMTP-aeb5cf0276bb7b658997281ba34abf6e69fe17bb.zip
security + bugs
Diffstat (limited to 'Postman/PostmanInputSanitizer.php')
-rw-r--r--Postman/PostmanInputSanitizer.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/Postman/PostmanInputSanitizer.php b/Postman/PostmanInputSanitizer.php
index e33f6c4..1b73378 100644
--- a/Postman/PostmanInputSanitizer.php
+++ b/Postman/PostmanInputSanitizer.php
@@ -93,6 +93,8 @@ if ( ! class_exists( 'PostmanInputSanitizer' ) ) {
$this->sanitizeString( 'Fallback username', PostmanOptions::FALLBACK_SMTP_USERNAME, $input, $new_input );
$this->sanitizePassword( 'Fallback password', PostmanOptions::FALLBACK_SMTP_PASSWORD, $input, $new_input, $this->options->getFallbackPassword() );
+ $new_input = apply_filters( 'post_smtp_sanitize', $new_input, $input, $this );
+
if ( $new_input [ PostmanOptions::CLIENT_ID ] != $this->options->getClientId() || $new_input [ PostmanOptions::CLIENT_SECRET ] != $this->options->getClientSecret() || $new_input [ PostmanOptions::HOSTNAME ] != $this->options->getHostname() ) {
$this->logger->debug( 'Recognized new Client ID' );
// the user entered a new client id and we should destroy the stored auth token
@@ -115,7 +117,8 @@ if ( ! class_exists( 'PostmanInputSanitizer' ) ) {
return $new_input;
}
- private function sanitizeString( $desc, $key, $input, &$new_input ) {
+
+ public function sanitizeString( $desc, $key, $input, &$new_input ) {
if ( isset( $input [ $key ] ) ) {
$this->logSanitize( $desc, $input [ $key ] );
$new_input [ $key ] = trim( $input [ $key ] );
@@ -130,7 +133,7 @@ if ( ! class_exists( 'PostmanInputSanitizer' ) ) {
* @param mixed $input
* @param mixed $new_input
*/
- private function sanitizePassword( $desc, $key, $input, &$new_input, $existingPassword ) {
+ public function sanitizePassword( $desc, $key, $input, &$new_input, $existingPassword ) {
// WordPress calling Sanitize twice is a known issue
// https://core.trac.wordpress.org/ticket/21989
$action = PostmanSession::getInstance()->getAction();