Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1964 RSS Internal feeds malformed

v1.9RC
closed-fixed
Oliver Hertel
5
2006-09-20
2005-05-11
bugmenot
No

My RSS feeds seem to have mixed URLs in the content.
For example, the first line "Tiki RSS feed for forum"
has the URL
http://realserver.url/tikiwiki/tiki-forum_rss.php?forumId=1
. The actual items in the forum, however, have an
incomplete url (missing the /tikiwiki/ subdir)
http://realserver.url/tiki-view_forum_thread.php?forumId=1&comments_parentId=0

Sample output:

<rss version="0.91">
<channel>
<title>Tiki RSS feed for forum: forumName</title>
<description></description>

<link>http://realserver.url/tikiwiki/tiki-forum_rss.php?forumId=1</link>
..
<image>
<url>http://realserver.url/img/tiki.jpg</url>

Discussion

  • Ralph Bolton
    Ralph Bolton
    2005-05-20

    Logged In: YES
    user_id=802047

    I too have seen this problem with 1.9.0 (from tw.o), but
    it's miraculously repaired itself, so I'm no closer to
    figuring it out. It's something to do with the httpPrefix
    method in tikilib.php, I think.

    I found the problem by doing the following (from scratch, no
    pre-existing install at all):

    1) Download the tar.gz
    2) Extract
    3) Move tiki-blabla to DOCUMENT_ROOT/tiki (and chown)
    4) Create user in mysql
    5) Browse to tiki-setup.php
    6) Do some basic config (not sure exactly what, but enabled
    blogs, wikis etc)
    7) Create a blog
    8) post a couple of test messages
    9) Clicked "RSS" icon, and received a message saying
    (something like)
    "Could not load library
    http://www.mysite.com/lib/rss/rsslib.php"
    (Note: that should read www.mysite.com/tiki/lib/rss/rsslib.php)

    That's resolved itself, and even the contents of the RSS are
    correct, but there's definitely something fishy going on. I
    note the code has changed significantly since 1.8.5, leading
    me to suspect tikilib.php (and the httpPrefix function).

     
  • Ralph Bolton
    Ralph Bolton
    2005-05-20

    Logged In: YES
    user_id=802047

    Also see bug 1184198

     
  • Michel Albert
    Michel Albert
    2005-06-02

    Logged In: YES
    user_id=560690

    I fixed this by changing line 186 in lib/rss/rsslib.php from

    $read = $this->httpPrefix()."/".$itemurl;

    into

    $read = $this->httpPrefix(). dirname($urlarray["path"]) ."/".$itemurl;

    This still leaves the urls in the "image" tag of the feed broken, but at least
    the links of the individual items work.

     
  • Kee Hinckley
    Kee Hinckley
    2005-08-08

    Logged In: YES
    user_id=871590

    I believe the following patch will fix the problem (at least, it has for me so
    far).

    [root@perforce tiki]# diff -u lib/rss/rsslib.php.old lib/rss/rsslib.php
    --- lib/rss/rsslib.php.old 2005-08-08 14:43:16.000000000 -0700
    +++ lib/rss/rsslib.php 2005-08-08 14:47:10.000000000 -0700
    @@ -160,6 +160,8 @@

    global $tikiIndex;
    global $userslib;
    +
    + $http_prefix = $this->httpPrefix().'/'.$this-
    >get_preference('http_prefix', '');

    if ($rss_version=='') {
    // override version if set as request parameter
    @@ -177,13 +179,13 @@

    $urlarray = parse_url($_SERVER["REQUEST_URI"]);

    - $url = htmlspecialchars($this-
    >httpPrefix().$_SERVER["REQUEST_URI"]);
    - $home = htmlspecialchars($this->httpPrefix()."/".$tikiIndex);
    - $img = htmlspecialchars($this->httpPrefix()."/img/tiki.jpg");
    + $url =
    htmlspecialchars($http_prefix.$_SERVER["REQUEST_URI"]);
    + $home = htmlspecialchars($http_prefix."/".$tikiIndex);
    + $img = htmlspecialchars($http_prefix."/img/tiki.jpg");

    $title = htmlspecialchars($title);
    $desc = htmlspecialchars($desc);
    - $read = $this->httpPrefix()."/".$itemurl;
    + $read = $http_prefix."/".$itemurl;

    // different stylesheets for atom and rss
    $cssStyleSheet = "";
    @@ -198,11 +200,11 @@

    switch ($rss_version) {
    case "1": // RSS 1.0
    - $cssStyleSheet = $this->httpPrefix()."/lib/rss/rss-
    style.css";
    + $cssStyleSheet = $http_prefix."/lib/rss/rss-style.css";
    break;
    case "2": // RSS 2.0
    - $cssStyleSheet = $this->httpPrefix()."/lib/rss/rss-
    style.css";
    - $xslStyleSheet = $this->httpPrefix()."/lib/rss/rss20.xsl";
    + $cssStyleSheet = $http_prefix."/lib/rss/rss-style.css";
    + $xslStyleSheet = $http_prefix."/lib/rss/rss20.xsl";
    break;
    case "3": // PIE 0.1
    break;
    @@ -210,10 +212,10 @@
    $contenttype = "text/plain";
    break;
    case "5": // ATOM0.3
    - $cssStyleSheet = $this->httpPrefix()."/lib/rss/atom-
    style.css";
    + $cssStyleSheet = $http_prefix."/lib/rss/atom-style.css";
    break;
    case "6": // OPML
    - $xslStyleSheet = $this->httpPrefix()."/lib/rss/opml.xsl";
    + $xslStyleSheet = $http_prefix."/lib/rss/opml.xsl";
    break;
    case "7": // HTML
    $contenttype = "text/plain";
    @@ -222,7 +224,7 @@
    $contenttype = "text/javascript";
    break;
    case "9": // RSS 0.91
    - $cssStyleSheet = $this->httpPrefix()."/lib/rss/rss-
    style.css";
    + $cssStyleSheet = $http_prefix."/lib/rss/rss-style.css";
    break;
    }

     
  • Oliver Hertel
    Oliver Hertel
    2006-09-20

    • assigned_to: nobody --> ohertel
    • status: open --> closed-fixed
     
  • Oliver Hertel
    Oliver Hertel
    2006-09-20

    Logged In: YES
    user_id=21633

    fixed for tiki 1.9.4 or newer