188 array-map-fixed fix
This commit is contained in:
@@ -320,29 +320,33 @@ arguments.requestArguments.specificationId=usrCustomerInfo.specificationId; //In
|
||||
<!--- интересная и неожиданная разница между циклом по массиву и циклом по индексу массива:
|
||||
в первом случае возвращается копия элемента, во втором мы естественно имеем дело со ссылокой на элемент,
|
||||
а нам сейчас нужно второе --->
|
||||
<cfloop query="local.qSubparam">
|
||||
<cfif local.qSubparam.is_sensitive AND structKeyExists(local.spMapArray[local.i],local.qSubparam.svc_operation_cfs_subparam)>
|
||||
<cfset local.spMapArray[local.i]["#local.qSubparam.svc_operation_cfs_subparam#"] = "********"/>
|
||||
</cfif>
|
||||
</cfloop>
|
||||
<cfif isStruct(local.spMapArray[local.i])>
|
||||
<cfloop query="local.qSubparam">
|
||||
<cfif local.qSubparam.is_sensitive AND structKeyExists(local.spMapArray[local.i],local.qSubparam.svc_operation_cfs_subparam)>
|
||||
<cfset local.spMapArray[local.i][local.qSubparam.svc_operation_cfs_subparam] = "********"/>
|
||||
</cfif>
|
||||
</cfloop>
|
||||
</cfif>
|
||||
</cfloop>
|
||||
|
||||
<!--- *** проверку, что это не map-fixed, можно добавить здесь --->
|
||||
<!--- чтобы не вставляли в параметр что попало --->
|
||||
<!--- здесь мы не делаем цикл по массиву, поскольку не поддерживаем массив расширяемых map --->
|
||||
<cfloop query="local.qInstSubparam">
|
||||
<cfset structInsert(mapDescriptor, local.qInstSubparam.instance_operation_cfs_subparam,
|
||||
{
|
||||
"note":"#local.qInstSubparam.note#",
|
||||
"isSensitive":#request.castToBool(local.qInstSubparam.is_sensitive)#,
|
||||
"isModifiableDefinition":true
|
||||
}, true
|
||||
)
|
||||
/>
|
||||
<cfif local.qInstSubparam.is_sensitive AND structKeyExists(local.spmap,local.qInstSubparam.instance_operation_cfs_subparam)>
|
||||
<cfset local.spmap["#local.qInstSubparam.instance_operation_cfs_subparam#"] = "********"/>
|
||||
</cfif>
|
||||
</cfloop>
|
||||
<cfif isStruct(local.spMapArray[1])>
|
||||
<cfloop query="local.qInstSubparam">
|
||||
<cfset structInsert(mapDescriptor, local.qInstSubparam.instance_operation_cfs_subparam,
|
||||
{
|
||||
"note":"#local.qInstSubparam.note#",
|
||||
"isSensitive":#request.castToBool(local.qInstSubparam.is_sensitive)#,
|
||||
"isModifiableDefinition":true
|
||||
}, true
|
||||
)
|
||||
/>
|
||||
<cfif local.qInstSubparam.is_sensitive AND structKeyExists(local.spMapArray[1],local.qInstSubparam.instance_operation_cfs_subparam)>
|
||||
<cfset local.spMapArray[1]["#local.qInstSubparam.instance_operation_cfs_subparam#"] = "********"/>
|
||||
</cfif>
|
||||
</cfloop>
|
||||
</cfif>
|
||||
|
||||
<cfset arguments.qParam.data_descriptor = mapDescriptor/>
|
||||
|
||||
@@ -499,4 +503,5 @@ arguments.requestArguments.specificationId=usrCustomerInfo.specificationId; //In
|
||||
|
||||
|
||||
|
||||
</cfcomponent>
|
||||
</cfcomponent>
|
||||
<!--- [{"b":"12","secret1":"preved"},{"b":"13","secret1":"preved404"},{"b":"14","secret1":"preved402"}] --->
|
||||
Reference in New Issue
Block a user