Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: & encoding in email subject and from name  (Read 13805 times)

0 Members and 1 Guest are viewing this topic.

Flagg

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 2
  • Flagg (aka Richard)
    • Richard & Vivian
& encoding in email subject and from name
« on: November 26, 2005, 11:57:29 am »

I'm running 1.4.2 coppermine and I have an issue with emails.

The title of the coppermine gallery is "Richard & Vivian"

When sending emails. eg password reminders, welcome emails, ecards etc. the email subject for example has an string & in it instead of &

For example: "Richard & Vivians Fotoalbums - New password request"

I think this is because of the general encoding, imho it should not encode in emails. As a wokaround i made the following change to mailer.inc.php at line 80

Original code

   $mail->FromName = $sender_name;
   $mail->Subject = $subject;

Replaced with new code

   $sender_name = str_replace("&", "&", $sender_name);
   $mail->FromName = $sender_name;
   $subject = str_replace("&", "&", $subject);
   $mail->Subject = $subject;

Flagg (aka Richard)
http://www.richardoe.nl
« Last Edit: August 19, 2006, 07:37:31 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: & encoding in email subject and from name
« Reply #1 on: August 10, 2006, 08:24:28 am »

Bumping thread to top. Issue still open?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: $HTML_SUBST problem in displayecard.php
« Reply #2 on: August 10, 2006, 08:48:39 am »

merging Titooy's report with another similar one.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: & encoding in email subject and from name
« Reply #3 on: August 13, 2006, 05:21:07 pm »

I split Titooy's report and merged it with a more related thread.

I confirmed this issue in 1.4.9 from svn.

I think the answer is in modifying include/mailer.inc.php by adding html_entity_decode() in the right place(s). Problem is I can't tell where.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: & encoding in email subject and from name
« Reply #4 on: August 14, 2006, 05:16:39 am »

I guess it's the same location as Flagg's suggested fix.

FIND:
Code: [Select]
   $mail->FromName = $sender_name;
   $mail->Subject = $subject;
   $mail->Body = $msg_body;

REPLACE with:
Code: [Select]
   $mail->FromName = html_entity_decode($sender_name);
   $mail->Subject = html_entity_decode($subject);
   $mail->Body = html_entity_decode($msg_body);

I'm guessing that that is all that needs to be replace. At least when I tested with the forgot password form, it looked fine. I didn't know what else to test with. The ecard email worked fine without the fix.

This needs to be confirmed with another dev.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: & encoding in email subject and from name
« Reply #5 on: August 19, 2006, 06:22:11 am »

Since the related bug was OK'd, is the fix here ok?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: & encoding in email subject and from name
« Reply #6 on: August 19, 2006, 07:37:17 am »

Guess so - this thread is identical to the other one that got fixed. Marking this one accordingly.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 18 queries.