htmentities adds a "1" to the end of my URL's (!)

Discussion in 'PHP' started by Space Goat, Oct 10, 2005.

  1. #1
    I've created an RSS feed, using an .xml file that the server parses as .php, for my forums to import content from my site. The URL of the feed is here: http://www.hypersyllogistic.com/rss/mustreadrss.xml

    The problem is, using either htmlentities or htmlspecialchars adds a "1" to the end of every URL! :eek: How can I resolve this?

    Here is the code for mustreadrss.xml:

    <?php
    header('Content-type: text/xml');
    [database inclusion censored]
    
    ?>
    <rss version="2.0">
    <channel>
    <title>Hypersyllogistic Must-Read Links</title>
    <description>Must-Read Links from the front page of Hypersyllogistic.</description>
    <link>http://www.hypersyllogistic.com</link>
    <copyright>Jason Vines, 2000-2005.</copyright>
    
    <?php
    $query = "SELECT link_name, link_url, link_description, UNIX_TIMESTAMP(date) AS link_date FROM fplinks ORDER BY fplink_id DESC";
    $result = mysql_query($query);
    
    while ($array = mysql_fetch_array ($result)) {
        $link_date = strftime("%a, %d %b %Y %T %Z",$array['link_date']);
        $link_name = htmlentities (strip_tags($array['link_name']), ENT_QUOTES);
        $link_url = htmlentities ($array['link_url'], ENT_QUOTES);
        $link_description = htmlentities (str_replace ("<br />", " ", $array['link_description']), ENT_QUOTES);
        $link_description = strip_tags($link_description);
    ?>
    
        
        <item>
        <title><?php print $link_name; ?></title>
        <description><?php print $link_description; ?></description>
        <link><?php print $link_url; ?></link>
        <pubDate><?php print $link_date; ?></pubDate>
        </item>
        
    <?php
    }
    ?>
    
    </channel>
    </rss>
    PHP:
     
    Space Goat, Oct 10, 2005 IP
  2. Space Goat

    Space Goat Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Never mind; the problem seems to have corrected itself. :confused:
     
    Space Goat, Oct 10, 2005 IP