K
K
Karen Kratyan2012-06-24 12:46:24
MODX
Karen Kratyan, 2012-06-24 12:46:24

Problem with cyrillic url addresses in modx revolution?

In the plugin (event OnHandleRequest) I try to get the url address, but it returns "-.html".
And tried like this:

$modx->request->parameters['GET'][$request_param_alias]
and so:
$_GET[$request_param_alias]
In general, you need to get the id of the requested resource. I do this:
$modx->aliasMap[$url_resource]
So, in Latin it shows normally, but there is a problem with the Cyrillic url address. How to fix or how to properly get the requested resource?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hungry_Hunter, 2012-06-24
@Hungry_Hunter

1. Register on www.phpclasses.org
2. Download the library www.phpclasses.org/package/1509-PHP-Convert-from-and-to-IDNA-Punycode-domain-names.html
3.

require_once 'idna_convert.class.php';
$IDN = new idna_convert();
$url_decode = $IDN->decode($url_resource);
//$url_decode - подставляете куда нужно вместо $url_resource

4. PROFIT!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question