safatshahin / moodle-mod_debate

Debate is a moodle activity which allows students to debate in a given topic inside moodle.
Other
2 stars 1 forks source link

Invalid processing of the input text #1

Closed mudrd8mz closed 3 years ago

mudrd8mz commented 3 years ago

When the input text is not a plain text (as dictated by PARAM_TEXT parameter) then the external function throws fatal error:

Invalid parameter value detected (Invalid external api parameter: the value is "<h", the server was expecting "text" type): Invalid external api parameter: the value is "<h", the server was expecting "text" type

image

Texts like this should be probably PARAM_RAW and be correctly processed upon output.

safatshahin commented 3 years ago

it's a mistake I make very often, made them param raw now. This error was coming find_debate_reponse, that already has a validation, so making it raw resolved it. I didn't restrict or filter in the add API while users add responses considering IT student might debate something with code or frond end stuff, as that's what I did a lot while studying in monash. Thanks a lot for finding this.