Zeokat / flarum-ext-seoslugs

MIT License
6 stars 2 forks source link

% in title gets converted to ASCII, breaks encoding #1

Open clarkwinkelmann opened 5 years ago

clarkwinkelmann commented 5 years ago

If you have a % followed by two numbers in a title, the value will be transformed into its ASCII value in the slug.

For example a title "%65" will result in the slug being "e".

This also means you can get non-printable chars in the slug, like with "%10".

This in turns breaks notably the Flagrow Sitemap extension, because such a char doesn't seem to be allowed in XML, and php isn't able to escape it apparently.

I see that you have a line designed to handle specifically this in the code, but I guess it doesn't work :man_shrugging:

Reported to be my TR-tr through an issue with the sitemap extension.

Zeokat commented 5 years ago

I have to check slowly this issue but into my forum when i use %10 the non-printable char is removed from the slug.

Into a first fast test seems that all works as expected, anyway i will check more in depth at the weekend.

clarkwinkelmann commented 5 years ago

On my local install it happens every time.

Note that the %10 is not visible in the url as it's a non-printable character, but you can see the discussion url is /d/<id>-<apparently nothing> (the dash shouldn't be here). You should see the strange character you have a look at the canonical url in the source code of the page (meta tag) or in the database.

image

%65 (or any visible characters) should en up in the url.

Let me know if you can't reproduce, I have not tried disabling all extensions on my test forum, but I have not found any reason another extension could interfere.

Zeokat commented 5 years ago

Yes, i can reproduce it. I have to investigate how to fix this bug.

Thanks for the report.