You are here

function _yandex_metrics_idna_decode in Yandex.Metrics 6

Same name and namespace in other branches
  1. 7 yandex_metrics.module \_yandex_metrics_idna_decode()

Decode ASCII 'xn--*' domain name to Unicode national domain name if it is possible. Used idna_convert class created by Matthias Sommerfeld <mso@phlylabs.de> and licensed under LGPL.

Parameters

$domain:

Return value

string

See also

http://www.phpclasses.org/package/1509-PHP-Convert-from-and-to-IDNA-Puny...

1 call to _yandex_metrics_idna_decode()
yandex_metrics_get_counter_for_current_site in ./yandex_metrics.module
Gets counter ID for the current site from Yandex.Metrics.

File

./yandex_metrics.module, line 1257
The main code of Yandex.Metrics module.

Code

function _yandex_metrics_idna_decode($domain) {
  $idna_library_path = _yandex_metrics_get_idna_library_path();

  // Library has not been found.
  if ($idna_library_path == FALSE) {
    return $domain;
  }
  require_once $idna_library_path;
  $IDN = new idna_convert();
  return $IDN
    ->decode($domain);
}