shish / shimmie2

An easy-to-install community image gallery (aka booru)
http://code.shishnet.org/shimmie2/
GNU General Public License v2.0
404 stars 113 forks source link

Cyrillic comments break posts #1043

Closed luRaichu closed 8 months ago

luRaichu commented 8 months ago

Server Software

Last night a Russian spambot left an anonymous comment in cyrillic on my public facing Shimmie install, rendering the respective post unviewable ONLY for admins. Normal users can view the post and comment correctly.

Here's what admins get when trying to view the affected post:

Internal Error
Message: Unexpected false

Version: 2.11.0-alpha (on 8.3.2-1+ubuntu22.04.1+deb.sury.org+1)

Stack Trace:

#0 /var/www/html/core/stdlib_ex.php(34): false_throws()
#1 /var/www/html/ext/comment/theme.php(258): json_encode_ex()
#2 /var/www/html/themes/lite/comment.theme.php(11): Shimmie2\CommentListTheme->comment_to_html()
#3 /var/www/html/ext/comment/theme.php(69): Shimmie2\CustomCommentListTheme->comment_to_html()
#4 /var/www/html/ext/comment/main.php(338): Shimmie2\CommentListTheme->display_comment_list()
#5 /var/www/html/ext/comment/main.php(216): Shimmie2\CommentList->onPageRequest_list()
#6 /var/www/html/core/send_event.php(161): Shimmie2\CommentList->onPageRequest()
#7 /var/www/html/index.php(91): Shimmie2\send_event()
#8 {main}

This also means we can't remove the comment without mucking with the server.

shish commented 8 months ago

Are you up to date on the main branch? 5d9090cd52b7fe3bc8e66a9ce19ffc795f8d3c60 should have fixed this a couple of weeks ago

shish commented 8 months ago

I'm pretty sure this is fixed, if not please comment with the exact git commit ID you're running <3

luRaichu commented 8 months ago

Sorry, I've forgotten to reply. Busy week.

I manually applied the fix from that commit and was able to view and delete the bad comment. However, how would I update Shimmie if I've already made mods to the engine? IIRC you can't git pull correctly if you've got local changes

shish commented 8 months ago

IIRC you can't git pull correctly if you've got local changes

If you git commit the changes (even just to your local copy, doesn't need to be published anywhere) then git pull should work. Specifically git pull by itself will attempt to merge your changes with upstream, and git pull --rebase will undo your changes, sync with upstream, and then redo your changes on top (I personally find the second one easier to work with, because that makes it easier to switch between "vanilla upstream" and "upstream plus my changes")

luRaichu commented 8 months ago

I get weird merge errors when attempting to pull.