Page 1 of 1

apostrophe in product name

Posted: Mon Nov 16, 2009 4:39 am
by jc-piazza
I have a product called Coffee Lover's Basket, but on both the order confirmation email and the order notification email the name comes out like this:

Coffee Lover's Basket

How do I fix that?

Also how do I force a line break between products? Multiple products show up all on one line in the confirmation emails.

Re: apostrophe in product name

Posted: Mon Nov 16, 2009 5:39 am
by Xsecrets
this is because everything is htlmencoded before it is put into the database. Is there really any purpose for this?

Re: apostrophe in product name

Posted: Mon Nov 16, 2009 5:41 am
by moggiex
Xsecrets wrote:this is because everything is htlmencoded before it is put into the database. Is there really any purpose for this?
I would have thought so, mainly because HTML can contain lots of junk which could break pages being viewed, also if php was added, it could cause undesired effects.

Matt

Re: apostrophe in product name

Posted: Mon Nov 16, 2009 6:13 am
by Xsecrets
moggiex wrote:
Xsecrets wrote:this is because everything is htlmencoded before it is put into the database. Is there really any purpose for this?
I would have thought so, mainly because HTML can contain lots of junk which could break pages being viewed, also if php was added, it could cause undesired effects.

Matt
well I certainly understand sanitizing the input, but I see no need to htmlencode it. It ends up causing lots of problems like the one mentioned here. I would imagine you could do a htmldecode before putting it into the email.

Re: apostrophe in product name

Posted: Mon Nov 16, 2009 6:28 am
by Qphoria
I agree with xsecrets... back in 0.x, one of the last main changes was to put proper html into the database instead of the entity characters.

so in the DB you can see '<table>' instead of '<table$gt;'. That fixes a lot of issues and need for encoding and decoding unnecessarily.

Was sad to see that change didn't make it to 1.x

Re: apostrophe in product name

Posted: Mon Nov 16, 2009 6:32 am
by jc-piazza
so is there any hope of a workaround?

Re: apostrophe in product name

Posted: Mon Nov 16, 2009 8:18 am
by dashik
I hope I'm understanding your problem correctly. Try using the html_entity_decode method....i've used it a few times with great results. Never with e-mails but you might be able to make it work.

Instead of:

Code: Select all

<?php echo $fieldname; ?>
Maybe try something like this:

Code: Select all

<?php echo html_entity_decode($fieldname); ?>
Hope that helps.