Sets the new url of the media item.

@param string $url URL of the media file
482486
public function setUrl( $url )
	{
		if ( $url == $this->getUrl() ) { return; }

		$this->_values['url'] = (string) $url;
		$this->setModified();
	}
711793
public function setLink($name, $url)
    {
        $name = trim(strtolower($name));

        if ($name == '_') {
            $name = array_shift($this->anonymous);
        }

        $this->links[$name] = trim($url);
    }
722042
public function updateURL(&$url) {
		if($this->owner instanceof \Image_Cached || $this->owner instanceof \CdnImage_Cached) {
			return; /** handled in @link ImageCachedExtension */
		}

        // in the CMS, we do _not_ change the asset
        $controller = Controller::has_curr() ? Controller::curr() : null;
        if ($controller instanceof LeftAndMain) {
            return;
        }

        if ($this->owner->CanViewType && $this->owner->getViewType() != CDNFile::ANYONE_PERM) {
            return;
        }

        $cdnLink = $this->getCdnLink();
        if ($cdnLink) {
            $url = $cdnLink;
        }
	}
1090771
public function setUrl ($url)
		{
			$this->authUrl = $url . '/oauth2/authorize';
			$this->tokenUrl = $url . '/oauth2/access_token';
			$this->apiBaseUrl = $url . '/users';
			$this->returnUrl = Yii::$app->request->hostInfo . '/' . Yii::$app->request->pathInfo;
		}
711379
public function withURL ($url)
    {
        if (filter_var($url, FILTER_VALIDATE_URL) === false) {
            throw new InvalidArgumentException("invalid url `{$url}` given for news item");
        }

        $new = clone $this;
        $new->url = $url;

        return $new;
    }
34335
public function addUrl(Url $url)
    {
        if ($this->isFull()) {
            throw new \RuntimeException('The urlset limit has been exceeded');
        }

        $urlXml = $url->toXml();
        $this->appendXML($urlXml);

        //add unknown custom namespaces
        $this->customNamespaces = array_merge($this->customNamespaces, $url->getCustomNamespaces());

        //---------------------
        //Check limits
        if ($this->countItems++ >= self::LIMIT_ITEMS) {
            $this->limitItemsReached = true;
        }

        $urlLength = strlen($urlXml);
        $this->countBytes += $urlLength;

        if ($this->countBytes + $urlLength + strlen($this->getStructureXml()) > self::LIMIT_BYTES) {
            //we suppose the next url is almost the same length and cannot be added
            //plus we keep 500kB (@see self::LIMIT_BYTES)
            //... beware of numerous images set in url
            $this->limitBytesReached = true;
        }
        //---------------------
    }
995176
public function setMediaUrl( $value )
	{
		if ( $value == $this->getMediaUrl() ) {
			return;
		}

		$this->_values['mediaurl'] = (string) $value;
		$this->setModified();
	}
1123211
public void setUrl(final String url) {
        final String old = this.url;

        this.url = url;
        this.connectionConfig = System.currentTimeMillis();
        this.connectionValidated = false;

        this.pcs.firePropertyChange("url", old, this.url);
    }
478994
public function setUrl($url)
    {
        $this->reset();

        foreach (parse_url($url) as $part => $value) {
            $this[$part] = $value;
        }
    }
11076
public function setWebHook($url)
    {
        $this->data->target = $url;
        $this->data->media = self::DEFAULT_MEDIA;

        return $this;
    }
230008
public function setVersionUrl($url)
    {
        if (!$this->validateAllowedUrl($url)) {
            throw new InvalidArgumentException(
                sprintf('Invalid url passed as argument: %s.', $url)
            );
        }
        $this->versionUrl = $url;
    }
496668
public function setUrl($url)
    {
        $this->url = $url;

        // Check if the url ends with a slash
        if ($this->url && substr($this->url, -1) !== '/') {
            $this->url .= '/';
        }

        return $this;
    }
1322884
public function setUrl($url)
    {
        $url = $this->url($url)->getPath();
        $this->url = $this->str($url)->trimRight('/')->val() . '/';
    }
480779
public function setUrl(?string $url): void
	{
		if ($this->locale === null) {
			throw new InvalidArgumentException('Locale must be set before calling setUrl');
		}
		if ($this->isLink === null) {
			throw new InvalidArgumentException("'isLink' must be set before calling setUrl");
		}
		if (!$this->isLink && Strings::match($url, '/[^A-Za-z0-9_-]/')) {
			throw new InvalidArgumentException('URL contains invalid characters');
		}

		$completeUrl = !$this->isLink && $this->parent && $url !== null ?
			$this->parent->completeUrl . '/' . $url
			: $url;

		/* @var $repository PagesRepository */
		$repository = $this->getRepository();
		$page = $repository->getByUrl($completeUrl, $this->locale->name);
		if ($page !== null && $page !== $this) {
			throw new UniqueConstraintViolationException("Page with '$url' exists");
		}
		$this->url = $url;
	}
756301
public function setUrl(string $url) : Request
    {
        $components = parse_url($url);

        if ($components === false) {
            throw new \InvalidArgumentException('The URL provided is not valid.');
        }

        if (! isset($components['scheme'])) {
            throw new \InvalidArgumentException('The URL must have a scheme.');
        }

        $scheme = strtolower($components['scheme']);

        if ($scheme !== 'http' && $scheme !== 'https') {
            throw new \InvalidArgumentException(sprintf('The URL scheme "%s" is not acceptable.', $scheme));
        }

        $isSecure = ($scheme === 'https');

        if (! isset($components['host'])) {
            throw new \InvalidArgumentException('The URL must have a host name.');
        }

        $host = $components['host'];

        if (isset($components['port'])) {
            $port = $components['port'];
            $hostHeader = $host . ':' . $port;
        } else {
            $port = ($isSecure ? 443 : 80);
            $hostHeader = $host;
        }

        $this->path = isset($components['path']) ? $components['path'] : '/';
        $requestUri = $this->path;

        if (isset($components['query'])) {
            $this->queryString = $components['query'];
            parse_str($this->queryString, $this->query);
            $requestUri .= '?' . $this->queryString;
        } else {
            $this->queryString = '';
            $this->query = [];
        }

        $this->setHeader('Host', $hostHeader);

        $this->host = $host;
        $this->port = $port;
        $this->isSecure = $isSecure;
        $this->requestUri = $requestUri;

        return $this;
    }
1339880
public function setUrl($url) {
        if (!is_string($url)) throw new IllegalTypeException('Illegal type of parameter $url: '.gettype($url));

        // TODO: validate URL

        if (strpos($url, ' ') !== false)
            throw new InvalidArgumentException('Invalid argument $url: '.$url);

        $this->url = $url;
        return $this;
    }
1286383
public function setTargetUrl($url)
    {
        if (empty($url)) {
            throw new \InvalidArgumentException('Cannot redirect to an empty URL.');
        }

        $this->targetUrl = $url;

        $this->setContent(
            sprintf('<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="0;url=%1$s" />

        <title>Redirecting to %1$s</title>
    </head>
    <body>
        Redirecting to <a href="%1$s">%1$s</a>.
    </body>
</html>', htmlspecialchars($url, ENT_QUOTES, 'UTF-8')));

        $this->headers->set('Location', $url);

        return $this;
    }