Laboratoire-de-Chemoinformatique / moodle-tiny_molstructure

0 stars 0 forks source link

does the return param need to be PARAM_RAW? #4

Closed danmarsden closed 3 months ago

danmarsden commented 3 months ago

https://github.com/Laboratoire-de-Chemoinformatique/moodle-tiny_molstructure/blob/MOODLE_401_STABLE/classes/external/image_generator.php#L107

might be able to use PARAM_TEXT or something else there.

cperves commented 3 months ago

I'm going to try PARAM_TEXT but initially I choose PARAM_RAW to prevent string to be cleaned by moodle What do you think about that?

cperves commented 3 months ago

since PARAM_RAW "specifies a parameter that is not cleaned/processed in any way except the discarding of the invalid utf-8 characters", I prefer letting this because the data transmitted are imageDataUrl type

danmarsden commented 3 months ago

Isn't that just a url and not an image?

cperves commented 3 months ago

No this an ImageDataUrl string

cperves commented 3 months ago

generated by chemDodle lib

danmarsden commented 3 months ago

just looks like it's returning a url to me - not an actual image - eg: https://github.com/Laboratoire-de-Chemoinformatique/moodle-tiny_molstructure/blob/MOODLE_401_STABLE/classes/external/image_generator.php#L104

but - not going to block approval on this.

cperves commented 3 months ago

Yes it returns the url of the create image, stored in Moodle entry dataImagUrl -> out Url

danmarsden commented 3 months ago

right - so a url is just text and doesn't need to be PARAM_RAW - it's probably safe as PARAM_TEXT instead.