[Admin-Area] Entities in forum name are not rendered

Submitted by Anonymous on Wed, 04/20/2011 - 19:17
Written by
Quix0r

Currently, because of my keyboard layout is US (for hacking it is more interesting than German layout) and therefore (because I'm a German citizen) I cannot enter German Umlaute (special characters only (?) available in Germany) and the sharp >s< and therefore I need to enter entities.

In the forum description, the entered entities are being rendered correctly but not in the forum's name.

Used version is 1.0.11 (Update is ongoing due to a lot patch rejections).

This is normal behaviour. Only the description is not filtered for HTML, because many people add HTML links and such.

You would need to alter unhtml() for this to work.

Best option is to copy those characters from a website (Wikipedia article).

I think, a serious forum admin would never attempt to "hack" his/her own forum. :) So the unhtml() call here could be easily removed because 'forum_name' is trustable.

Okay, removal does break the RSS feeds. :( So a different solution is required.

Hmmm, you don't use CDATA in your RSS feeds. It is recommended to use e.g. with entities (named and numerical likewise).

The forum name is quite scattered around the code, so removing the unhtml() calls would have to happen in several files.

CDATA was used at one point in time. Don't remember why it got removed. The HTML is encoded now, the feeds parse with Google Reader and are valid according to the Feed Validation Service.

If you like, you can take my RSS feed as example: http://www.wds66.com/rss.xml it should be 100% conform with w3.org: Validate my RSS feed. You can also test your own feeds there. I use html_entity_decode() with a 2nd and 3rd parameter to decode the entities into the right (UTF-8 is my choice) character set.

Here is my little function:

// Decode entities
function decodeEntities ($str, $quote = ENT_NOQUOTES) {
return str_replace('&quot;', '"', html_entity_decode($str, $quote, 'UTF-8'));
}

Feel free to replace (when will it become configurable? hint, hint!) UTF-8 with ISO. That extra str_replace() was required here, some-why?

In the database there are no entities, except for posts made with different encodings in the browser. Other entities are generated by unhtml and the BBCode markup for RSS feeds. This fits in the way the RSS feeds are generated in 1.0.

I don't exclude any better ways, but did not research this at this point. 2.0 will have new code anyway.

Decoding all entities also wouldn't work, e.g. because Russian posts with nothing but entities in a ISO-8859-1 page can not be mapped to ISO-8859-1 (that's why the browser has sent entities). You need a character set that maps to all possible characters, but UTF-8 is not supported in 1.0.

Only 2.0+ will support UTF-8 and likely nothing else.

gefrorherz

Mon, 09/10/2012 - 09:16

I have a question how or where or what file controls the board description and de board name I need to do a correction in the names of this but I donĀ“t find it . please help

ACP -> General Configuration -> first two input fields you see.

Also, this is an old topic on a different issue. Please open new topics for new questions. Closing this.