I have a form which runs a server action, the action has a Text to Image ste in it.
If i ask it to create this text: BOTSWANA & ZIMBABWE WILDLIFE ODYSSEY
It throws the following error
{
"status": "500",
"message": "Input buffer has corrupt header: glib: XML parse error: Error domain 1 code 68 on line 11 column 82 of data: xmlParseEntityRef: no name",
"stack": "Error: Input buffer has corrupt header: glib: XML parse error: Error domain 1 code 68 on line 11 column 82 of data: xmlParseEntityRef: no name"
}
If i change the text to: BOTSWANA AND ZIMBABWE WILDLIFE ODYSSEY
It works, so it does not like the & ampersand symbol, I also tried changing it to & which also does not work.
Any ideas on how i can get this to work including special characters, considering I am unsure what people may possibly type in there? @Teodor would you mind testing possibly if this is a bug or just me.
Not sure if that will help, but can you try applying the encodeurl formatter on the POST value in your server action, where you pass its value to the text-to-image?
Thanks Teo, tried that, unfortunately I get the same error which is kind of even more strange to be honest because how does it know %26 is the & symbol if it is not decoding the input.
Original Text: BOTSWANA & ZIMBABWE WILDLIFE ODYSSEY
URL Encoded: BOTSWANA%20%26%20ZIMBABWE%20WILDLIFE%20ODYSSEY
Error is:
{
"status": "500",
"message": "Input buffer has corrupt header: glib: XML parse error: Error domain 1 code 68 on line 11 column 84 of data: xmlParseEntityRef: no name",
"stack": "Error: Input buffer has corrupt header: glib: XML parse error: Error domain 1 code 68 on line 11 column 84 of data: xmlParseEntityRef: no name"
}
And if I change the ampersand to the actual word AND then i get this result without any error.
Original Text: BOTSWANA AND ZIMBABWE WILDLIFE ODYSSEY
URL Encoded: BOTSWANA%20AND%20ZIMBABWE%20WILDLIFE%20ODYSSEY
Just a strange update, it accepts other characters, such as É so it seems like it just really does not like ampersand symbols, for now I am just using the_text.replace('&','and') to work around this.