exislow / kleinanzeigen-magic

[DO NOT USE] [Or you will get blocked! This app need re-factoring.] Speed up your eBay Kleinanzeigen workflows -- for free!
GNU Affero General Public License v3.0
45 stars 7 forks source link

Bug: Quote in Title during offering recreation (push up button) is shown as " #24

Closed Falcosc closed 2 years ago

Falcosc commented 2 years ago

If you push the ad up, it will recreate the offering totally fine (great job!) But " is not handled correctly and does not get unescaped during ad creation.

  1. Kleinanzeigen web page: Create an ad with Title: This is a "Test"
  2. Kleinanzeigen-Magic: Hit push to top on This is a "Test"

Expected title: This is a "Test" Actual title: This is a "Test"

exislow commented 2 years ago

Thanks for the report. I can confirm this bug. It also happens while using / and other special characters which need to be encoded if put into an XML structure. The Kleinanzeigen API works using XML syntax, this is why encoding is important here. But honestly I was not able to figure out so far how to fix this behavior.

I am open for any suggestions.

Falcosc commented 2 years ago

Sounds strange, I thought about accidentally double escaping.

Probably not worth investigating this minor this, but if you like the challenge, here are some more ways to escape characters:

https://stackoverflow.com/questions/1091945/what-characters-do-i-need-to-escape-in-xml-documents/46637835#46637835

This stackoverflow post confirms my thought that CDATA could work: https://www.w3.org/TR/REC-xml/#sec-cdata-sect

Falcosc commented 2 years ago

If it is a tag value instead of a attribute value then " doesn't need escaping at all https://www.liquid-technologies.com/XML/EscapingData.aspx

exislow commented 2 years ago

Fixed with release v0.7.0. Get it here https://github.com/exislow/kleinanzeigen-magic/releases/tag/v0.7.0