Cleans the request URI

@param  string  $uri     uri to clean
@param  bool    $strict  whether to remove relative directories
430641
public static function clean_uri($uri, $strict = false)
	{
		$filters = \Config::get('security.uri_filter', array());
		$filters = is_array($filters) ? $filters : array($filters);

		$strict and $uri = preg_replace(array("/\.+\//", '/\/+/'), '/', $uri);

		return static::clean($uri, $filters);
	}
339076
public function clearCache($uri = null)
    {
        if ($uri) {
            $this->clearCached($uri, true, true, true);
            $this->clearCached($uri, true, true, false);
            $this->clearCached($uri, true, false, true);
            $this->clearCached($uri, true, false, false);
            $this->clearCached($uri, false, true, true);
            $this->clearCached($uri, false, true, false);
            $this->clearCached($uri, false, false, true);
            $this->clearCached($uri, false, false, false);
        } else {
            $this->cache = [];
        }

        return $this;
    }
557933
public function delete($uri)
	{
		$ch = $this->initializeRequest();

		curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
		curl_setopt($ch, CURLOPT_URL, $uri);
		curl_exec($ch);

		$this->checkResponse($ch);

		curl_close($ch);

		return $this;
	}
1331610
public function resolveRawAlias(string $uri): ?array
    {
        $this->normalizeUri($uri, $name);

        while (isset($this->aliases[$name])) {
            $alias = $this->aliases[$name];
            $name = $alias['alias'];
        }

        return $alias ?? null;
    }
321674
function _set_uri_string($str)
	{
		// Filter out control characters
		$str = remove_invisible_characters($str, FALSE);

		// If the URI contains only a slash we'll kill it
		$this->uri_string = ($str == '/') ? '' : $str;
	}
171118
public static function isAbsolute($uri): bool
    {
        $null = $uri instanceof Psr7UriInterface ? '' : null;

        return $null !== self::filterUri($uri)->getScheme();
    }
612394
public static function parseUri(string $uri){
        if(1 !== preg_match(static::REGEX_URI, $uri, $m)){
            return false;
        }

        $result = [
            "scheme"    => $m["scheme"] ?? "",
            "userinfo"  => $m["userinfo"] ?? "",
            "host"      => $m["host"] ?? "",
            "port"      => "" === $m["port"] ? null : (int)$m["port"],
            "path"      => $m["path"] ?? "",
            "query"     => $m["query"] ?? "",
            "fragment"  => $m["fragment"] ?? "",
        ];

        return $result;
    }
1267229
public function uriDoesContain($search, $active = NULL, $strict = false)
	{
		return $this->urlDoesContain($search, $active, $strict);
	}
243290
protected function prepareUrlForRequest($uri)
    {
        if (Str::startsWith($uri, '/')) {
            $uri = substr($uri, 1);
        }

        if (! Str::startsWith($uri, 'http')) {
            $uri = ($this->baseUrl ?? config('app.url')) . '/' . $uri;
        }

        return trim($uri, '/');
    }
1352147
public function checkUri($uris)
    {
        if (!$this->request) {
            return false;
        }

        foreach ((array)$uris as $uri) {
            if ($this->uri == $uri) {
                return true;
            }
        }

        return false;
    }
1114111
public static function removeSchemeFromUri($uri, &$scheme = "")
    {
        $scheme = "";

        return preg_replace_callback("/^[a-z0-9+\.\-]+:\/\//", function ($matches) use (&$scheme) {
            $scheme = $matches[0];
            return "";
        }, $uri);
    }
1196836
public function handle($uri = null)
    {
        $method = $this->prepareMethodName();

        if (empty($uri)) {
            $uri = $this->getRewriteUri();
        }

        $uri = trim($uri, '/');

        // remove empty cells
        $parts = [];
        foreach (explode('/', $uri) as $p) {
            if (trim($p) !== '') {
                $parts[] = $p;
            }
        }

        $this->extractLanguage($parts);

        // check if it is REST or not, then do what is required
        $this->prepareRestRequest($parts);

        // Cleaning route parts & Rebase array keys
        $parts[] = strtolower(self::DEFAULT_ACTION);
        $camelizedParts = $parts;

        $camelizedParts = array_values(array_map('Rad\Utility\Inflection::camelize', $camelizedParts));
        $bundle = reset($camelizedParts);
        $bundles = array_intersect([$bundle, 'App'], Bundles::getLoaded());

        foreach ($bundles as $bundleName) {
            // reset manipulation parameters
            $dummyCamelizedParts = $camelizedParts;
            $dummyParts = $parts;

            if ($bundleName === 'App' && $dummyCamelizedParts[0] != 'App') {
                array_unshift($dummyParts, $bundleName);
                array_unshift($dummyCamelizedParts, $bundleName);
            } else {
                // get bundle namespace instead of its name
                array_shift($dummyCamelizedParts);
                array_unshift($dummyCamelizedParts, trim(Bundles::getNamespace($bundleName), '\\'));
            }

            // add "Action" to array as second param
            array_splice($dummyCamelizedParts, 1, 0, 'Action');

            $this->routingPhase = self::ROUTING_PHASE_ACTION;
            /**
             * routingPhase is sequence of three phases, in the following order
             * 1- direct call of action
             * 2- direct call of method
             * 3- direct call of index action
             */

            // Continue searching till you found any matching
            // Or you have at least three elements in array (Bundle, "Action", Action)
            while (count($dummyCamelizedParts) >= 3) {
                $actionNamespace = implode('\\', $dummyCamelizedParts) . 'Action';

                if (class_exists($actionNamespace)) {
                    $this->finalizeRouterArguments(
                        $dummyParts,
                        $dummyCamelizedParts,
                        $actionNamespace,
                        $bundleName,
                        $method
                    );

                    break 2;
                }

                array_pop($dummyCamelizedParts);

                // change router for some other default paths
                switch ($this->routingPhase) {
                    case self::ROUTING_PHASE_INDEX:
                        $this->routingPhase = self::ROUTING_PHASE_ACTION;
                        break;
                    case self::ROUTING_PHASE_METHOD:
                        $dummyCamelizedParts[] = self::DEFAULT_ACTION;
                        $this->routingPhase--;
                        break;
                    case self::ROUTING_PHASE_ACTION:
                        $dummyCamelizedParts[] = $method;
                        $this->routingPhase--;
                        break;
                }
            }
        }
    }
1010169
def delete_resource(uri)
      clear
      uri = URI.parse(uri)
      @req = Net::HTTP::Delete.new uri.request_uri
      set_common_info(@req)
      @http_class.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
        @res = http.request(@req)
        case @res
          when Net::HTTPSuccess
            #warn "Bad Status Code: #{@res.code}" unless @res.class == Net::HTTPOK || @res.class == Net::HTTPNoContent
          else
            raise RequestError, "Failed to delete resource. #{@res.code}"
          end
      end
    end
893120
public function stripRefreshTokenValue(string $uri): string
    {

        // If we have 'refresh_token' in the URI, strip it.
        if (strpos($uri, 'refresh_token'))
            return Uri::withoutQueryValue((new Uri($uri)), 'refresh_token')
                ->__toString();

        return $uri;
    }
1016164
public function clear($uri)
    {
        $this->checkURI($uri);
        unset($this->pclasses);
        if (file_exists($uri)) {
            unlink($uri);
        }
    }
1355734
private function cleanupQuery(string $uri): string
    {
        if (false !== $pos = strpos($uri, '?')) {
            return substr($uri, 0, $pos);
        }

        return $uri;
    }
1156404
private function prepareUriForLocalhostAccess($uri)
    {
        $public = 'public';
        $index = 'index.php';

        if (strpos($uri, $index)) {
            return substr($uri, strpos($uri, $index) + strlen($index));
        } elseif (strpos($uri, $public)) {
            return substr($uri, strpos($uri, $public) + strlen($public));
        }

        return false;
    }