Changeset 1947
- Timestamp:
- 10/07/2015 11:52:06 AM (9 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/bootstrap.php
r995 r1947 15 15 require_once( __DIR__ . '/classes/wordcamp-payments.php' ); 16 16 require_once( __DIR__ . '/classes/payment-request.php' ); 17 require_once( __DIR__ . '/classes/encryption.php' ); 17 18 18 19 $GLOBALS['wordcamp_payments'] = new WordCamp_Payments(); -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/classes/payment-request.php
r1939 r1947 382 382 break; 383 383 } 384 385 $encrypted_fields = array( 386 'payable_to', 387 'beneficiary_name', 388 'beneficiary_account_number', 389 'beneficiary_street_address', 390 'beneficiary_city', 391 'beneficiary_state', 392 'beneficiary_zip_code', 393 'beneficiary_country', 394 ); 395 396 if ( in_array( $name, $encrypted_fields ) ) { 397 $decrypted = WCP_Encryption::maybe_decrypt( $value ); 398 if ( ! is_wp_error( $decrypted ) ) 399 $value = $decrypted; 400 } 401 384 402 385 403 return $value; … … 768 786 protected function sanitize_save_normal_fields( $post_id ) { 769 787 foreach ( $_POST as $key => $unsafe_value ) { 788 $unsafe_value = wp_unslash( $unsafe_value ); 789 770 790 switch ( $key ) { 771 791 case 'description': … … 828 848 829 849 if ( ! is_null( $safe_value ) ) { 850 $encrypted_fields = array( 851 'payable_to', 852 'beneficiary_name', 853 'beneficiary_account_number', 854 'beneficiary_street_address', 855 'beneficiary_city', 856 'beneficiary_state', 857 'beneficiary_zip_code', 858 'beneficiary_country', 859 ); 860 861 if ( in_array( $key, $encrypted_fields ) ) { 862 $encrypted_value = WCP_Encryption::encrypt( $safe_value ); 863 if ( ! is_wp_error( $encrypted_value ) ) 864 $safe_value = $encrypted_value; 865 } 866 830 867 update_post_meta( $post_id, '_camppayments_' . $key, $safe_value ); 831 868 }
Note: See TracChangeset
for help on using the changeset viewer.