# Purify

This Component has methods which make it easy to escape any special characters like in HTML we can escape `<, >` so that html does not get interpreted by the browser which can cause injection vulnerabilities.

The component can be found at `sirJuni\Framework\Components\Purify`. The methods are static so we don't need an instance to make use of it.

## Escaping HTML

To escape quotes in HTML, we can use the html method of this class. It basically escape the `<, >` so that html is not interpreted.

```php
use sirJuni\Framework\Components\Purify;

$safe_text = Purify::html("<h1>Hello</h1>");
```

## Sanitize URL

To sanitize URLs by URL Encoding any special characters we use the `link` method and pass it the url.

```php
$url = "https://hello.com^/xyz*";
$safe_url = Purify::link($url);     // returns https://hello.com%5E/xyz%2A
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shoaib-1.gitbook.io/sirjuni/purify.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
