1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Zend_Http_Client can't handle %20?

Discussion in 'XenForo Development Discussions' started by Jaxel, Feb 6, 2011.

  1. Jaxel

    Jaxel Well-Known Member

    I am trying to use Zend_Http_Client to reach two different URLs...

    The first URL works fine:
    The problem is with the second URL:
    I get kicked out with the following error:
    Path "/albums/y268/Eyce/Broken%20Destiny%20Art%20Pack/http://photobucket.com/albums/y268/Eyce/Broken Destiny Art Pack/" is not a valid HTTP path

    Is this normal?
  2. Jaxel

    Jaxel Well-Known Member

    Let me give a bit more detail...
    $source "http://s7.photobucket.com/albums/y268/Eyce/Broken%20Destiny%20Art%20Pack/";


    // "y268/Eyce/Broken%20Destiny%20Art%20Pack"
    $service_value $matches[1];

    // "http://www.photobucket.com/albums/y268/Eyce/Broken%20Destiny%20Art%20Pack/"
    $service_feed "http://www.photobucket.com/albums/{serviceVAL}/";
    $service_feed str_replace('{serviceVAL}'$service_value$service_feed);

    $client = new Zend_Http_Client($service_feed);
    $feed $client->request()->getBody();
    This takes the source URL, matches it against a regular expression and extracts the $service_value and stores it in a variable. Then it takes the $service_value, and places it into the appropriate area of $service_feed. Then it tries to connect to $service_feed using Zend_Http_Client...

    The system fails on the last line with the error:
    Path "/albums/y268/Eyce/Broken%20Destiny%20Art%20Pack/http://photobucket.com/albums/y268/Eyce/Broken Destiny Art Pack/" is not a valid HTTP path
  3. Shadab

    Shadab Well-Known Member

    Photobucket, when directing you to the non-www version doesn't return a well-formed URI.
    Using the non-www version directly seems to work:

    $service_feed = "http://photobucket.com/albums/{serviceVAL}/";
  4. Jaxel

    Jaxel Well-Known Member

    Thanks... that fixed it... The problem was with photobucket, not my code.

Share This Page