Forums

Maybe bug in php function parse_url? (3 posts)

  1. iks
    Member
    Posted 4 years ago #

    I try to get rss from my forum. Link to forum rss looks like this:
    http://my_site/forum/external.php?type=rss2&forumids=62 (by this link there is a forum theme). When I tried to do this, I have an error in case, that I see rss of all forum, not for mentioned theme.

    When I look in code, in file class-snoopy.php, I see on line 133, in function 'function fetch($URI)', line
    $URI_PARTS = parse_url($URI);

    When I look at variable $URI_PARTS, I see this:

    Array ( [scheme] => http [host] => my_site [path] => /forum/external.php [query] => type=rss2& [fragment] => 038;forumids=62 )

    So, I see, that forumids=62 linked to section 'fragment', though I think, that forumids=62 must be linked to section 'query'. There is a bug.
    I'll edit file class-snoopy.php, function fetch($URI), and after lines

    if (empty($URI_PARTS["path"]))
             $URI_PARTS["path"] = '';

    add lines

    if (!empty($URI_PARTS['fragment']))
             $URI_PARTS["query"] .= substr($URI_PARTS['fragment'], 4, strlen($URI_PARTS['fragment']));

    By the manual of php function parse_url, I see this:

    query - after the question mark ?
    fragment - after the hashmark #

    And I don't understand, why ?type=rss2&forumids=62 disjointed on query and fragment. Maybe it's bug? :)

    Sorry for my bad english...
    PS. Уфф, замахался писАть... :)

  2. Lester Chan
    Member
    Posted 4 years ago #

    and what does that have to do with WP even though it uses snoopy?

  3. iks
    Member
    Posted 4 years ago #

    Only that I see rss not for a concrete theme, but for all forum themes...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags