Forums / Bug Reports / [Done v1.6.0] email confirmation gets truncated on the < symbol in product names

[Done v1.6.0] email confirmation gets truncated on the < symbol in product names

Started by vetpro on 3 Jan 2013, 1:25 PM · Views: 1,669

Results 1 to 4 of 4
3 Jan 2013, 1:25 PM
#1
vetpro avatar

vetpro

New Zenner

Join Date:
Oct 2011
Posts:
15
Plugin Contributions:
0

[Done v1.6.0] email confirmation gets truncated on the < symbol in product names

It happens in the email confirmation that you receive once a customer orders products.
i have products with description like
Advantage Kitten <4kg 6 packs

the the symbol '<' triggers a truncation in the email so i have to log into the admin section to print off the order to fulfill.
this was identified in another version, is there a fix for this or should i go ahead and remove all the < symbols.

here is the older thread about this

http://www.zen-cart.com/showthread.php?71105-Done-2-0-0-Truncated-email-notices-if-product-names-contain-lt-symbol&highlight=email+confirmation

any help will be appreciated.

Thanks.

3 Jan 2013, 1:26 PM
#2
vetpro avatar

vetpro

New Zenner

Join Date:
Oct 2011
Posts:
15
Plugin Contributions:
0

Re: [Done v1.6.0] email confirmation gets truncated on the < symbol in product names

i use the latest version of zen cart, 1.5.1

3 Jan 2013, 10:34 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.6.0] email confirmation gets truncated on the < symbol in product names

The quick fix is to use a space, like this:
Advantage Kitten < 4kg 6 packs

instead of:
Advantage Kitten <4kg 6 packs

and that will fix it for now ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

24 Jul 2013, 1:29 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: [Done v1.6.0] email confirmation gets truncated on the < symbol in product names

Two options:

a) use the space, like Ajeh mentioned. That's the simplest.

b) or use the following code change, which will be included in v1.6.0:

      if ($email_text == '') {
        $email_text = str_replace(array('<br>','<br />'), "<br />\n", $block['EMAIL_MESSAGE_HTML']);
        $email_text = str_replace('</p>', "</p>\n", $email_text);
        $email_text = ($module != 'xml_record') ? htmlspecialchars(stripslashes(strip_tags($email_text)), ENT_COMPAT, CHARSET, TRUE) : $email_text;
      } else {
        $email_text = ($module != 'xml_record') ? strip_tags($email_text) : $email_text;
       }

becomes:

      if ($email_text == '') {
        $email_text = str_replace(array('<br>','<br />'), "<br />\n", $block['EMAIL_MESSAGE_HTML']);
        $email_text = str_replace('</p>', "</p>\n", $email_text);
         $email_text = ($module != 'xml_record') ?  zen_output_string_protected(stripslashes(strip_tags($email_text))) :  $email_text;
      } else if ($module != 'xml_record') {
        $email_text = preg_replace("/<([^[:alpha:]])/", '@lt@\\1', $email_text);
        $email_text = strip_tags($email_text);
        $email_text = str_replace('@lt@', '<', $email_text);
      }

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.