Jump to content

Recommended Posts

I wrote this little thing ...
[code]<?php $rss = fetch_rss('http://www.example.com/feed');
foreach ( $rss->items as $item ) {
echo " <a href=\"{$item['link']}\" title=\"{$item['title']}\">" . $item['title'] . "</a>";
break;
} ?>[/code]

to go the the URL provided and grab the RSS feed and echo out the first post. It works perfectly except the link doesn't work. It renders as a link, blue and underlined, but when you put your mouse over, the text selecting cursor remains. It doesn't change to a hand like normals links do. I open the source code and find this...

[code]<a xhref="http://www.example.com/feed/Post+Title" title="Post Title">Post Title</a>[/code]

Notice the "xhref" in there. The code does not contain the 'x', but when the HTML is echoed out it shows up. Has anyone EVER seen this before? ANY help is very much appreciated.

EDIT: I should probably add that 'fetch_rss' is obviously not a basic function, but rather one that I wrote as well.
Link to comment
https://forums.phpfreaks.com/topic/27624-solved-echo-echos-extra-character/
Share on other sites

I've noticed before, when using TinyMCE in a project, manually typing HTML into it causes issues like this. I'm not sure if it is some kinda protection against users adding in rogue code or what, but I fix it at the output stage with some str_replace() 's. Either that, or check the documentation for a switch that disables this 'feature'.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.