Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix truncation issues once and for all #102

Merged
merged 1 commit into from
Mar 17, 2013
Merged

Fix truncation issues once and for all #102

merged 1 commit into from
Mar 17, 2013

Conversation

ctrlcctrlv
Copy link
Contributor

I've been working on this commit for a while, and my original work all had to do with keeping HTML entities intact.

I scrapped all of that in favor of this simple change. This permanently fixes the truncation issues that plague tinyboard, but is still secure (i.e., it still encodes <, >, &, etc).

The truncation issue is very simple, currently, when Tinyboard receives a Unicode filename, like スクリーンショット<b>.png, it converts it into HTML entities...

&#12473;&#12463;&#12522;&#12540;&#12531;&#12471;&#12519;&#12483;&#12488;&lt;b&gt;.png

And then erroneously uses these to truncate at the set number, which not only slices in the wrong place, but cuts HTML entities in half, resulting in &#12473;&#12463;&#12522;&#1254 or スクリӦ….

This affects all fields with truncation, including the body text, which can also be truncated in the middle of an HTML entity.

I tried to fix this a few different ways but eventually just decided it's 2013 and server admins should set their Content-Type to utf-8 already. I hope you will accept this pull request.

2013-03-17-070939_906x359_scrot
This image shows the fix with this patch.

savetheinternet pushed a commit that referenced this pull request Mar 17, 2013
Fix truncation issues once and for all
@savetheinternet savetheinternet merged commit 31a21a5 into savetheinternet:master Mar 17, 2013
Circlepuller pushed a commit to Circlepuller/Tinyboard that referenced this pull request Jul 24, 2017
…error

[bugfix]$config['error']['genwebmerror'] wasn't set in config.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants