Closed KrunchMuffin closed 7 years ago
interesting, are you noticing this on a particular version of CF/Railo/Lucee?
On Thu, Sep 15, 2016 at 8:18 AM, Derek notifications@github.com wrote:
Seems the sanitizeDump is getting tripped up on JSON keys with null values.
An error ocurred while rendering ExtraInfo! Element customfield_10002 is undefined in a CFML structure referenced as part of an expression.
"customfield_10001": "10901:1:0|10400:1:20200", "customfield_10002": null,
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oarevalo/BugLogHQ/issues/146, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI6NHbXWxRQ-ziJI1U-m-lyzHws0RwNks5qqWHFgaJpZM4J9_lt .
Oscar Arevalo twitter: @oarevalo https://twitter.com/oarevalo gh: https://github.com/oarevalo b: http://www.oscararevalo.com
Sorry, ACF11
it might be a CF thing. I ran this code in Railo 4.1 and the bug report was added to BugLog without any issue:
json = deserializeJSON("{'a':1,'b':2,'c':null}");
application.buglog.notifyService(
message = "a json with a null",
extraInfo = json
);
Does this reflect your use case?
yes, pretty much. it's puking on line 563 <cfif isStruct(arguments.data[local.i])>
i wonder if a !isNull(arguments.data[local.i]) && isStruct(....)
would take care of the problem here. Is that something you can quickly try?
I actually did this and it worked...
<cfif !StructKeyExists(arguments.data,local.i)>
<cfset arguments.data[local.i] = "null">
</cfif>
i'm not sure that does the same thing... that part of the code what is supposed to do is to check if the value of an attribute of the given struct is itself a struct, so that it then checks if the individual members of that struct need to be sanitized.
If I remember correctly this was added in case the extraInfo
had for example a form
attribute with all the input fields on the submitted form, in which fields like password
or credit_card_number
or things like that should be scrubbed before being sent to the buglog server.
With this fix it looks more like it will remove anything that is not a struct.
oops nevermind.... i thought you were doing another isStruct
; but with now I see what you are trying to do.
Can you post the entire body of the sanitizeKeyData
function? or even better submit a PR?
sure
Seems the sanitizeDump is getting tripped up on JSON keys with null values.