Create, sanitize and compare urls.
More...
|
static | isValidMultiByteUrl (string $url) |
| Use a "fixed" filter_var() with FILTER_VALIDATE_URL that handles multi-byte chars. More...
|
|
Create, sanitize and compare urls.
- Since
- 4.3
Definition at line 11 of file Urls.php.
Elgg\Http\Urls::addActionTokensToUrl |
( |
string |
$url, |
|
|
bool |
$html_encode = false |
|
) |
| |
Adds action tokens to URL.
Use this function to append action tokens to a URL's GET parameters. This will preserve any existing GET parameters.
- Parameters
-
string | $url | Full action URL |
bool | $html_encode | HTML encode the url? (default: false) |
- Returns
- string URL with action tokens
- Examples:
- /root/Elgg/engine/classes/Elgg/Http/Urls.php.
Definition at line 69 of file Urls.php.
Elgg\Http\Urls::addQueryElementsToUrl |
( |
string |
$url, |
|
|
array |
$elements |
|
) |
| |
Sets elements in a URL's query string.
- Parameters
-
string | $url | The URL |
array | $elements | Key/value pairs to set in the URL. If the value is null, the element is removed from the URL. |
- Returns
- string The new URL with the query strings added
- Examples:
- /root/Elgg/engine/classes/Elgg/Http/Urls.php.
Definition at line 22 of file Urls.php.
Elgg\Http\Urls::arrayDiffAssocRecursive |
( |
| ) |
|
|
protected |
Elgg\Http\Urls::buildUrl |
( |
array |
$parts, |
|
|
bool |
$html_encode = true |
|
) |
| |
Elgg\Http\Urls::isUrlIdentical |
( |
string |
$url1, |
|
|
string |
$url2, |
|
|
array |
$ignore_params |
|
) |
| |
Test if two URLs are functionally identical.
If $ignore_params is used, neither the name nor its value will be considered when comparing.
The order of GET params doesn't matter.
- Parameters
-
string | $url1 | First URL |
string | $url2 | Second URL |
array | $ignore_params | GET params to ignore in the comparison |
- Returns
- bool
- Examples:
- /root/Elgg/engine/classes/Elgg/Http/Urls.php.
Definition at line 190 of file Urls.php.
static Elgg\Http\Urls::isValidMultiByteUrl |
( |
string |
$url | ) |
|
|
static |
Use a "fixed" filter_var() with FILTER_VALIDATE_URL that handles multi-byte chars.
This function is static because it is used in . During installation this service can't be constructed because the database is not yet available.
- Parameters
-
string | $url | URL to validate |
- Returns
- bool
- Examples:
- /root/Elgg/engine/classes/Elgg/Http/Urls.php.
Definition at line 276 of file Urls.php.
Elgg\Http\Urls::normalizeUrl |
( |
string |
$url | ) |
|
The documentation for this class was generated from the following file: