Jump to content

html entities in mail subject


Manaus
 Share

Recommended Posts

Hello,

I have a page whose title contains a ' (single quote)

Now when I get it and send it as mail subject, I get ' which is quite uninpressive... I tried to convert it using html_entity_decode() but it's not working.

How can I deal with it?

Thanks!!

Link to comment
Share on other sites

I am not sure why you are ending up with the numerical character reference in there. Does it appear that way in the HTML of the mail subject field, or not until it is actually sent? Are you using one of the new custom email modules, or the built-in one?

Can you try to figure out exactly when it is being converted? When you view the source, are you seeing ' or just '

There are functions out there to decode NCRs, but it is overkill for your needs and also I think it would be better to figure out why/where it's happening in the first place.

If you can't manage to figure out the cause and you're in a rush, you could just do a str_replace in your email script to put it back to a single quote.

Link to comment
Share on other sites

  • 3 years later...

If anyone else gets stuck, you can just do this and get the unencoded field value (assuming it's encoded with HTML Entity Encoder like above):

ecbho $page->getUnformatted('field_name');

  • Like 1
Link to comment
Share on other sites

1 minute ago, Pete said:

If anyone else gets stuck, you can just do this and get the unencoded field value (assuming it's encoded with HTML Entity Encoder like above):

 


ecbho $page->getUnformatted('field_name');

 

Yeah, although an echo would probably work better :P

  • Like 2
Link to comment
Share on other sites

ecbho sounds like I'm down with the kids though I think - I'm sure it's one of those made-up words they use nowadays *shakes walking stick whilst muttering about the good old days* :D

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...