Changeset 8914 for lang/php/Scraper

Show
Ignore:
Timestamp:
04/05/08 17:11:38 (6 years ago)
Author:
sasezaki
Message:

lang/php/Scraper: Diggin/Uri/Http.phpの中身がscraperから分離前だったのをfix

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/php/Scraper/library/Diggin/Uri/Http.php

    r8906 r8914  
    2525     * @return string 
    2626     */ 
    27     public function getAbsoluteUrl($href) 
     27    public function getAbsoluteUrl($url, $base_url) 
    2828    { 
    29         $parse = parse_url($href); 
     29        $parse = parse_url($url); 
    3030        if (isset($parse["host"])) { 
    31             $build = $href; 
     31            $build = $url; 
    3232        } else { 
    33             $uri = $this->getHttpClient()->getUri(TRUE); 
    34             $uridir = pathinfo(parse_url($uri, PHP_URL_PATH), PATHINFO_DIRNAME); 
     33            $uridir = pathinfo(parse_url($base_url, PHP_URL_PATH), PATHINFO_DIRNAME); 
    3534            $slash = strpos($uridir, '/'); 
    3635            if ($slash === false) { 
    37                 $build = http_build_url($uri, array("path" => $href,), 
     36                $build = http_build_url($base_url, array("path" => $url,), 
    3837                HTTP_URL_STRIP_QUERY | HTTP_URL_STRIP_FRAGMENT); 
    3938            } else {             
    40                 $build = http_build_url($uri, array("path" => $href,),  
     39                $build = http_build_url($base_url, array("path" => $url,),  
    4140                HTTP_URL_JOIN_PATH | HTTP_URL_STRIP_QUERY | HTTP_URL_STRIP_FRAGMENT); 
    4241            }