[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/flow](../../README) / [index](../README) / sanitizeUrl

# Function: sanitizeUrl()

> **sanitizeUrl**(`url`): `string`

Defined in: [flow/src/urlSafety.ts:74](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/urlSafety.ts#L74)

Return `url` when it is safe, or [BLOCKED\_URL](../variables/BLOCKED_URL) when it would execute.

Applied to every URL-bearing attribute the renderer emits and every one the bridge writes
from server-pushed state, so `<a href={this.profile.website}>` cannot become one-click XSS
because a user typed a scheme into a profile field.

## Parameters

### url

`string`

The candidate URL.

## Returns

`string`

The original URL, or [BLOCKED\_URL](../variables/BLOCKED_URL).
