Skip to main content
Topic: " becomes " (Read 2144 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

" becomes "

The entity " is getting unparsed. It should remain & quot; (without the space). Even happens in code tags.

Let me see about the other entities:

" => &quot
' => &apos
< => &lt
Quote => &gt
& => &amp

Yep. Quote and add the ; to test.

Re: " becomes "

Reply #1

ehh... I never really understood why entities are translated... :-\


Re: " becomes "

Reply #3

Sigh

Re: " becomes "

Reply #4

Yeah, we discovered this bug in a private conversation, randomly. :/

Re: " becomes "

Reply #5

This is caused by our Utill function which set the htmlspecialchars flag to not double encode by default.

So although those characters are being saved as show meaning if you enter &quot ; that's what is saved in the DB, however to actually display it that way you need to do a &amp ;quot ; junk.

So to fix,
1) could enable double encode by default, but that gets ugly in some cases.
2) Just double encode in the preview and post areas, so in post.controller do
Code: [Select]
$form_message = Util::htmlspecialchars($_REQUEST['message'], ENT_QUOTES, 'UTF-8', true);
and
Code: [Select]
			$_POST['message'] = Util::htmlspecialchars($_POST['message'], ENT_QUOTES, 'UTF-8', true);
3) Just do it for code blocks?  Is there a reason to display it as the entity outside of a code block?

Re: " becomes "

Reply #6

Not sure the answer but I know that it shouldn't just do it in code blocks.

Re: " becomes "

Reply #7

Has this been fixed in the end?  O:-)



 

Re: " becomes "

Reply #10

" => &quot;
' => &apos;
< => &lt;
Quote => &gt;
& => &amp;

Code: [Select]
&quot; &amp; &lt; or " & <