• 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. Уфф, замахался писАть… 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Maybe bug in php function parse_url?’ is closed to new replies.