private function processURL($url) {

        // Clean up special characters in url params
        $url = str_replace("%20", " ", $url);

        // Store a private copy for use later
        $this->url = URLHelper::$testURL == null ? $url : URLHelper::$testURL;

        // Split it on protocol first if required.
        if (substr($url, 0, 4) == "http") {
            $splitProtocol = explode("://", $url);
            $requestSection = sizeof($splitProtocol) > 1 ? $splitProtocol [1] : $splitProtocol [0];
            $requestSection = substr($requestSection, strpos($requestSection, "/"));
        } else {
            $requestSection = $url;
        }
        $this->requestURI = $requestSection;

        // Now split it on question mark for query if required.
        $splitQuestionMark = explode("?", $requestSection);
        $queryStripped = $splitQuestionMark [0];

        // Now ensure no trailing or leading slash.
        if (substr($queryStripped, 0, 1) == '/') $queryStripped = substr($queryStripped, 1);
        if (substr($queryStripped, strlen($queryStripped) - 1) == '/') $queryStripped = substr($queryStripped, 0, strlen($queryStripped) - 1);

        // Now simply set the segments array to be the split on "/"
        $this->segments = explode("/", $queryStripped);

    }
private function processURL($url) {

        // Clean up special characters in url params
        $url = str_replace("%20", " ", $url);

        // Store a private copy for use later
        $this->url = URLHelper::$testURL == null ? $url : URLHelper::$testURL;

        // Split it on protocol first if required.
        if (substr($url, 0, 4) == "http") {
            $splitProtocol = explode("://", $url);
            $requestSection = sizeof($splitProtocol) > 1 ? $splitProtocol [1] : $splitProtocol [0];
            $requestSection = substr($requestSection, strpos($requestSection, "/"));
        } else {
            $requestSection = $url;
        }
        $this->requestURI = $requestSection;

        // Now split it on question mark for query if required.
        $splitQuestionMark = explode("?", $requestSection);
        $queryStripped = $splitQuestionMark [0];

        // Now ensure no trailing or leading slash.
        if (substr($queryStripped, 0, 1) == '/') $queryStripped = substr($queryStripped, 1);
        if (substr($queryStripped, strlen($queryStripped) - 1) == '/') $queryStripped = substr($queryStripped, 0, strlen($queryStripped) - 1);

        // Now simply set the segments array to be the split on "/"
        $this->segments = explode("/", $queryStripped);

    }
private function processURL ( $ url ) { // Clean up special characters in url params $ url = str_replace ( "%20" , " " , $ url ) ; // Store a private copy for use later $ this -> url = URLHelper :: $ testURL == null ? $ url : URLHelper :: $ testURL ; // Split it on protocol first if required. if ( substr ( $ url , 0 , 4 ) == "http" ) { $ splitProtocol = explode ( "://" , $ url ) ; $ requestSection = sizeof ( $ splitProtocol ) > 1 ? $ splitProtocol [ 1 ] : $ splitProtocol [ 0 ] ; $ requestSection = substr ( $ requestSection , strpos ( $ requestSection , "/" ) ) ; } else { $ requestSection = $ url ; } $ this -> requestURI = $ requestSection ; // Now split it on question mark for query if required. $ splitQuestionMark = explode ( "?" , $ requestSection ) ; $ queryStripped = $ splitQuestionMark [ 0 ] ; // Now ensure no trailing or leading slash. if ( substr ( $ queryStripped , 0 , 1 ) == '/' ) $ queryStripped = substr ( $ queryStripped , 1 ) ; if ( substr ( $ queryStripped , strlen ( $ queryStripped ) - 1 ) == '/' ) $ queryStripped = substr ( $ queryStripped , 0 , strlen ( $ queryStripped ) - 1 ) ; // Now simply set the segments array to be the split on "/" $ this -> segments = explode ( "/" , $ queryStripped ) ; }
off query parameters too.
off query parameters too .