POV-Ray : Newsgroups : povray.general : Server failure : Re: Server failure Server Time
29 Apr 2024 08:35:19 EDT (-0400)
  Re: Server failure  
From: Chris Cason
Date: 2 Apr 2021 23:55:49
Message: <6067e745$1@news.povray.org>
On 3/04/2021 04:54, Bald Eagle wrote:
> No idea if this is related to the utf-8 issues.
> I was trying to answer someone else's question and came across this old post:
> 
>
http://news.povray.org/povray.advanced-users/message/%3Cweb.57a001e45c93b6e65e7df57c0%40news.povray.org%3E/#%3Cweb.57a0
> 01e45c93b6e65e7df57c0%40news.povray.org%3E
> 
> I don't recall it looking like that when it was originally posted ....

Interesting find. I've looked at the raw message on the NNTP server and 
it does in fact have the entity encoding present; e.g.

   x = & #961;cos(& #952;)sin(& #934;)
   y = & #961;sin(& #952;)sin(& #934;)
   z = & #961;cos(& #934;)

(Note I have spaced these out so they won't be classed as HTML entities 
and re-encoded by the server. The original had no spaces). This is how 
it would have appeared to NNTP users. The HTML entities are due to it 
being posted via the web interface and were sucked into the NNTP side as-is.

When re-displaying them, PHP's htmlentities() function is (correctly) 
escaping them as it assumes the input is not HTML formatted.

There is a way of telling htmlentities() to not re-encode existing 
encoded sequences, and I thought that may have been a default value 
change between the old and new PHP, but the docs don't say so, and 
google's cache from 4 March (so before the crash) shows it with the 
escaping also:

http://webcache.googleusercontent.com/search?q=cache:YzzVZteLENYJ:news.povray.org/web.57a001e45c93b6e65e7df57c0%2540news.povray.org

so I suspect it's probably been like that for a while. That said, 
though, it is an issue - either we ought to decode entity-encoded HTML 
before putting it into the NNTP server, or we need to not double-encode 
them when pulling out for display.

Given the data is already stored I can't change the first option, so for 
now I've turned on the second one (existing HTML encoding is passed over).

I'll need to have a think about what implications this might have going 
forward as I'm not sure it's the right fix (e.g. perhaps to only apply 
it to posts that were originally made via the web interface).,

-- Chris


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.