Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Can anyone tell me why we are getting spaces and line breaks in code that should be rock solid out of wordpress?

  1. If you visit this page: http://lab.focusww.com/product/conway-stewart-wordsworth-shingle-fountain-pen/
  2. enter you email address (works with gmail) and submit
  3. check your email and find a message from 'Chatterley Luxuries and Pen Time '
  4. notice the broken image in the middle of the email

When I look at the broken image's url I see this:

http (there is a line break here followed by a space) ://lab.focusww.com/wp-content/uploads/2012/11/shingle-wordsworth-300x195.jpg

Note the line break.

This image is created using a plugin we wrote. It uses Wordpress's built in function to generate the product's thumbnail and email it. we are using

get_the_post_thumbnail($_product->ID, 'medium')

Wordpress uses this thumbnail function all the time on our site. Can you guys give us any clue where the extra space or line break would be added? I don't want to waste anyone's time, we've been working on this for 5 days.

Thanks for any help.

(Note, if you need more details, please give a chance to elaborate before killing/deleting my question. Some editors won't even give you 8 hours to respond or react. I welcome any suggestions to make this a better question.)

share|improve this question
Did you check your encodings? Most of the time, when something like this happens, you have a few files using full UTF-8 instead of UTF-8 without BOM, or inconsistencies between ANSI and UTF-8 (without BOM) – fischi Dec 4 '12 at 6:54
It was not an encoding issue. – Nohl Dec 4 '12 at 16:31
Clarification: The php script that we were using has a 1000 character limit and every time we hit that limit a line break and a return were added. Sloppy work on our part. Sorry to bother people. – Nohl Dec 16 '12 at 5:59

closed as too localized by Chip Bennett, toscho Dec 4 '12 at 18:15

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

It turns out the problem had nothing to do with encoding.

Our email was longer than 1000 characters and a carriage return was being added automatically.

I'll get the details of how we fixed it and post them here. It was fixed in the php code of our plugin.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.