So, our site has news stories that can be shared in Twitter and Facebook. In both FF and Chrome, the twitter link works fine, no problem. However, IE decided that it doesn't like the quotation marks and will send an HTML 400 Bad Request every time we try to share a story via our site that has quotation marks inside of it. What breaks in particular is related to the_title()
and not the_permalink()
.
The code section in question:
<a href="https://twitter.com/home?status=<?php the_title(); ?> - <?php the_permalink(); ?>" target="_blank" onclick="return !window.open(this.href, 'Share on Twitter', 'width=500,height=500')"><img src="<?php echo get_template_directory_uri(); ?>/img/share-tw1.png" width="28" height="28" /></a>
I've tried to wrap the_title()
in parens and apply urlencode
or htmlspecialchars
or anything else like it and have had no luck encoding a generated URL. (It generates based on the title of the story and the URL linking to it).
Can anyone help or provide insight as to what needs to happen in order for IE to accept quotation marks?