Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/180343

Change subject: Trim all strings in a message when dequeueing
......................................................................

Trim all strings in a message when dequeueing

Seems like wmf_civicrm_normalize_msg is the best place to put this
so we only have to do it once.  Should stop some failmail.

Change-Id: I9d982fb208fdf509e8450f9e76e03501200c897b
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/43/180343/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 476d1ea..600aa1b 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -1152,6 +1152,15 @@
         $msg = json_decode( $msg->body, true );
     }
 
+       $trim_strings = function( $input ) {
+               if ( !is_string( $input ) ) {
+                       return $input;
+               }
+               return trim( $input );
+       };
+
+       $msg = array_map( $trim_strings, $msg );
+
     //defaults: Keys that aren't actually required, but which will cause some 
portion of the code to complain
     //if they don't exist (even if they're blank).
     // FIXME: don't use defaults.  Access msg properties using a functional 
interface.

-- 
To view, visit https://gerrit.wikimedia.org/r/180343
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d982fb208fdf509e8450f9e76e03501200c897b
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to