Manaus Posted March 25, 2014 Share Posted March 25, 2014 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 More sharing options...
adrian Posted March 26, 2014 Share Posted March 26, 2014 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 More sharing options...
Martijn Geerts Posted March 26, 2014 Share Posted March 26, 2014 What text formatters you've assigned to the field you're outputting? 1 Link to comment Share on other sites More sharing options...
Manaus Posted March 26, 2014 Author Share Posted March 26, 2014 Thanks Adrian and Martijn! I see the field it's a standard title field, with Html Entity Encoder (htmlspecialchars) I guess I gotta change it... Link to comment Share on other sites More sharing options...
Pete Posted March 1, 2018 Share Posted March 1, 2018 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'); 1 Link to comment Share on other sites More sharing options...
kongondo Posted March 1, 2018 Share Posted March 1, 2018 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 2 Link to comment Share on other sites More sharing options...
Pete Posted March 1, 2018 Share Posted March 1, 2018 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* 2 Link to comment Share on other sites More sharing options...
tpr Posted March 1, 2018 Share Posted March 1, 2018 flu perhaps? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now