#37 Undefined URI_PARTS["path"]

closed-fixed
None
5
2005-02-03
2005-01-06
No

In method fetch(), I'm getting an undefined error for
URI_PARTS["path"], I think if the line is pre-pended
with @ it takes care if it.

@$path = $URI_PARTS["path"].($URI_PARTS["query"] ?
"?".$URI_PARTS["query"] : "");

Using PHP5 under Windows.

Discussion

  • Gene Wood

    Gene Wood - 2005-02-02

    Logged In: YES
    user_id=547273

    Can you paste in the error that you're getting and the
    version of snoopy you have installed?

    prepending with @ merely makes the error not display, I'd
    rather fix the problem.

     
  • Michael Tacelosky

    Logged In: YES
    user_id=733175

    the problem is that $URI_PARTS['path'] isn't defined, and
    PHP5 (finally) displayed notices (including undefined
    variables) by default.

    a quick solution is to add
    if (!isset($URI_PARTS['path']))
    $URI_PARTS['path'] = '';

    OR

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

    and then $path .= for the query

    I'm not sure if the QUERY element is always set, to be safe
    you could say

    $path .= empty($URI_PARTS["query"]) ?
    '' : "?".$URI_PARTS["query"]);

     
  • Gene Wood

    Gene Wood - 2005-02-03
    • assigned_to: nobody --> gene_wood
    • status: open --> closed-fixed
     
  • Gene Wood

    Gene Wood - 2005-02-03

    Logged In: YES
    user_id=547273

    I've incorporated your fix into the codebase. You can find
    it in CVS and it will be part of the next release.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks