mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 00:07:26 +00:00
Revert "Add support UTF-8 domain names in black, white and exclude lists. (#1892)"
This reverts commit baab54de6f29c92aa3ed27c1f78c85e9b9d8c2ba.
This commit is contained in:
parent
de405eb21d
commit
370750b499
1
Makefile
1
Makefile
@ -97,7 +97,6 @@ CORE_DEPENDS?= ${CORE_DEPENDS_${CORE_ARCH}} \
|
||||
php${CORE_PHP}-filter \
|
||||
php${CORE_PHP}-gettext \
|
||||
php${CORE_PHP}-hash \
|
||||
php${CORE_PHP}-intl \
|
||||
php${CORE_PHP}-json \
|
||||
php${CORE_PHP}-ldap \
|
||||
php${CORE_PHP}-mcrypt \
|
||||
|
||||
@ -240,73 +240,4 @@ class SettingsController extends ApiMutableModelControllerBase
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* get action
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
$result = parent::getAction();
|
||||
if (isset($result['proxy']['forward']['acl']['whiteList'])) {
|
||||
$result['proxy']['forward']['acl']['whiteList'] = self::decode($result['proxy']['forward']['acl']['whiteList']);
|
||||
}
|
||||
if (isset($result['proxy']['forward']['acl']['blackList'])) {
|
||||
$result['proxy']['forward']['acl']['blackList'] = self::decode($result['proxy']['forward']['acl']['blackList']);
|
||||
}
|
||||
if (isset($result['proxy']['forward']['icap']['exclude'])) {
|
||||
$result['proxy']['forward']['icap']['exclude'] = self::decode($result['proxy']['forward']['icap']['exclude']);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* set action
|
||||
* @return array status
|
||||
*/
|
||||
public function setAction()
|
||||
{
|
||||
$result = parent::setAction();
|
||||
$mdlProxy = $this->getModel();
|
||||
if (isset($mdlProxy->forward->acl->whiteList)) {
|
||||
$mdlProxy->forward->acl->whiteList = self::decode($mdlProxy->forward->acl->whiteList);
|
||||
}
|
||||
if (isset($mdlProxy->forward->acl->blackList)) {
|
||||
$mdlProxy->forward->acl->blackList = self::decode($mdlProxy->forward->acl->blackList);
|
||||
}
|
||||
if (isset($mdlProxy->forward->icap->exclude)) {
|
||||
$mdlProxy->forward->icap->exclude = self::decode($mdlProxy->forward->icap->exclude);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode a given UTF-8 domain name
|
||||
* @param string Domain name (UTF-8 or UCS-4)
|
||||
* @return string Encoded Domain name (ACE string)
|
||||
*/
|
||||
public static function encode($domains)
|
||||
{
|
||||
$result = array();
|
||||
foreach (explode(",", $domains) as $domain) {
|
||||
if ($domain != "") {
|
||||
$result[] = ($domain[0] == "." ? "." : "") . idn_to_ascii($domain);
|
||||
}
|
||||
}
|
||||
return implode(",", $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a given ACE domain name
|
||||
* @param string Domain name (ACE string)
|
||||
* @return string Decoded Domain name (UTF-8 or UCS-4)
|
||||
*/
|
||||
public static function decode($domains)
|
||||
{
|
||||
$result = array();
|
||||
foreach ($domains as $domain => $element) {
|
||||
$result[idn_to_utf8($domain)] = array('value' => idn_to_utf8($element['value']), 'selected' => $element['selected']);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user