Correct blocklist/allowlist language
This commit is contained in:
		
							parent
							
								
									8c1fc8a032
								
							
						
					
					
						commit
						35402a0d18
					
				
					 5 changed files with 9 additions and 20 deletions
				
			
		|  | @ -16,13 +16,13 @@ function on_ios11() { | |||
|   , modalIframe: null | ||||
|   } | ||||
|   const commitchange = windowAsAny.commitchange; | ||||
|   commitchange.getParamsFromUrl = (whitelist:any) => { | ||||
|   commitchange.getParamsFromUrl = (allowlist:any) => { | ||||
|       var result:any = {}, | ||||
|           tmp = []; | ||||
|       var items = location.search.substr(1).split("&"); | ||||
|       for (var index = 0; index < items.length; index++) { | ||||
|           tmp = items[index].split("="); | ||||
|           if (whitelist.indexOf(tmp[0])) result[tmp[0]] = decodeURIComponent(tmp[1]); | ||||
|           if (allowlist.indexOf(tmp[0])) result[tmp[0]] = decodeURIComponent(tmp[1]); | ||||
|       } | ||||
|       return result; | ||||
|   } | ||||
|  |  | |||
|  | @ -23,13 +23,13 @@ window.commitchange = { | |||
| , modalIframe: null | ||||
| } | ||||
| 
 | ||||
| commitchange.getParamsFromUrl = (whitelist) => { | ||||
| commitchange.getParamsFromUrl = (allowlist) => { | ||||
|     var result = {}, | ||||
|         tmp = []; | ||||
|     var items = location.search.substr(1).split("&"); | ||||
|     for (var index = 0; index < items.length; index++) { | ||||
|         tmp = items[index].split("="); | ||||
|         if (whitelist.indexOf(tmp[0])) result[tmp[0]] = decodeURIComponent(tmp[1]); | ||||
|         if (allowlist.indexOf(tmp[0])) result[tmp[0]] = decodeURIComponent(tmp[1]); | ||||
|     } | ||||
|     return result; | ||||
| } | ||||
|  |  | |||
|  | @ -18,7 +18,7 @@ import {ApiManager} from "../../lib/api_manager"; | |||
| import * as CustomAPIS from "../../lib/apis"; | ||||
| import {CSRFInterceptor} from "../../lib/csrf_interceptor"; | ||||
| import {CreateOffsiteDonation, CreateOffsiteDonationModel} from "../../lib/api/create_offsite_donation"; | ||||
| import blacklist from "validator/lib/blacklist"; | ||||
| import blocklist from "validator/lib/blacklist"; | ||||
| import * as _ from 'lodash'; | ||||
| import moment from 'moment'; | ||||
| import { castToUndefinedIfBlank } from '../../lib/utils'; | ||||
|  | @ -140,14 +140,9 @@ class CreateNewOffsitePaymentPane extends React.Component<CreateOffsitePaymentPa | |||
|       'gross_amount': createFieldDefinition({name: 'gross_amount',  | ||||
|         label: 'Gross Amount', | ||||
|         input: (amount:number) => centsToDollars(amount), | ||||
|         output: (dollarString:string) => parseFloat(blacklist(dollarString, '$,')), | ||||
|         output: (dollarString:string) => parseFloat(blocklist(dollarString, '$,')), | ||||
|         value: 0 | ||||
|       }), | ||||
|       // 'fee_total': createFieldDefinition({name: 'fee_total', label: 'Fees',
 | ||||
|       //   input: (amount:number) => centsToDollars(amount),
 | ||||
|       //   output: (dollarString:string) => parseFloat(blacklist(dollarString, '$,')),
 | ||||
|       //   value: 0
 | ||||
|       // }),
 | ||||
|       'date': createFieldDefinition({name: 'date', label: 'Date', | ||||
|         input: (isoTime:string) => this.nonprofitTimezonedDates.readable_date(isoTime), | ||||
|         output:(date:string) =>  this.nonprofitTimezonedDates.readable_date_time_to_iso(date), | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ import {TwoColumnFields} from "../common/layout"; | |||
| import {Validations} from "../../lib/vjf_rules"; | ||||
| import * as _ from 'lodash' | ||||
| import {Dedication, parseDedication, serializeDedication} from '../../lib/dedication'; | ||||
| import blacklist from "validator/lib/blacklist"; | ||||
| import blocklist from "validator/lib/blacklist"; | ||||
| import {createFieldDefinition} from "../../lib/mobx_utils"; | ||||
| import Modal from "../common/Modal"; | ||||
| import ReactInput from "../common/form/ReactInput"; | ||||
|  | @ -186,12 +186,12 @@ class EditPaymentPane extends React.Component<EditPaymentPaneProps & WrappedComp | |||
|       'gross_amount': createFieldDefinition({ | ||||
|         name: 'gross_amount', label: 'Gross Amount', value: this.props.data.gross_amount, | ||||
|         input: (amount: number) => centsToDollars(amount), | ||||
|         output: (dollarString: string) => parseFloat(blacklist(dollarString, '$,')) | ||||
|         output: (dollarString: string) => parseFloat(blocklist(dollarString, '$,')) | ||||
|       }), | ||||
|       'fee_total': createFieldDefinition({ | ||||
|         name: 'fee_total', label: 'Fees', value: this.props.data.fee_total, | ||||
|         input: (amount: number) => centsToDollars(amount), | ||||
|         output: (dollarString: string) => parseFloat(blacklist(dollarString, '$,')) | ||||
|         output: (dollarString: string) => parseFloat(blocklist(dollarString, '$,')) | ||||
|       }), | ||||
|       'date': createFieldDefinition({ | ||||
|         name: 'date', label: 'Date', | ||||
|  |  | |||
|  | @ -68,12 +68,6 @@ module Commitchange | |||
|     # like if you have constraints or database-specific column types | ||||
|     config.active_record.schema_format = :sql | ||||
| 
 | ||||
|     # Enforce whitelist mode for mass assignment. | ||||
|     # This will create an empty whitelist of attributes available for mass-assignment for all models | ||||
|     # in your app. As such, your models will need to explicitly whitelist or blacklist accessible | ||||
|     # parameters by using an attr_accessible or attr_protected declaration. | ||||
|     # config.active_record.whitelist_attributes = true | ||||
| 
 | ||||
|     # Enable the asset pipeline | ||||
|     config.assets.enabled = true | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Eric Schultz
						Eric Schultz