diff --git a/src/bb-modules/Servicedomain/Api/Guest.php b/src/bb-modules/Servicedomain/Api/Guest.php index 4fdc9f393..4e9bfef2c 100644 --- a/src/bb-modules/Servicedomain/Api/Guest.php +++ b/src/bb-modules/Servicedomain/Api/Guest.php @@ -94,7 +94,7 @@ class Guest extends \Api_Abstract ); $this->di['validator']->checkRequiredParamsForArray($required, $data); - $sld = $data['sld']; + $sld = htmlspecialchars($data['sld'], ENT_QUOTES | ENT_HTML5, 'UTF-8'); $validator = $this->di['validator']; if (!$validator->isSldValid($sld)) { throw new \Box_Exception('Domain :domain is not valid', array(':domain' => $sld)); @@ -139,4 +139,4 @@ class Guest extends \Api_Abstract return TRUE; } -} \ No newline at end of file +} diff --git a/src/bb-modules/Servicedomain/Service.php b/src/bb-modules/Servicedomain/Service.php index 06acde637..b66032f97 100644 --- a/src/bb-modules/Servicedomain/Service.php +++ b/src/bb-modules/Servicedomain/Service.php @@ -69,7 +69,8 @@ class Service implements \Box\InjectionAwareInterface } if (!$validator->isSldValid($data['owndomain_sld'])) { - throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $data['owndomain_sld'])); + $safe_dom = htmlspecialchars($data['owndomain_sld'], ENT_QUOTES | ENT_HTML5, 'UTF-8'); + throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $safe_dom)); } $required = array( @@ -85,7 +86,8 @@ class Service implements \Box\InjectionAwareInterface } if (!$validator->isSldValid($data['transfer_sld'])) { - throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $data['transfer_sld'])); + $safe_dom = htmlspecialchars($data['transfer_sld'], ENT_QUOTES | ENT_HTML5, 'UTF-8'); + throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $safe_dom)); } $required = array( @@ -115,7 +117,8 @@ class Service implements \Box\InjectionAwareInterface } if (!$validator->isSldValid($data['register_sld'])) { - throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $data['register_sld'])); + $safe_dom = htmlspecialchars($data['register_sld'], ENT_QUOTES | ENT_HTML5, 'UTF-8'); + throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $safe_dom)); } $required = array( @@ -559,7 +562,8 @@ class Service implements \Box\InjectionAwareInterface $validator = $this->di['validator']; if (!$validator->isSldValid($sld)) { - throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $sld)); + $safe_dom = htmlspecialchars($sld, ENT_QUOTES | ENT_HTML5, 'UTF-8'); + throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $safe_dom)); } if (!$model->allow_register) { @@ -1074,4 +1078,4 @@ class Service implements \Box\InjectionAwareInterface } -} \ No newline at end of file +} diff --git a/src/bb-modules/Support/Service.php b/src/bb-modules/Support/Service.php index c2cebeafb..4cb372e04 100644 --- a/src/bb-modules/Support/Service.php +++ b/src/bb-modules/Support/Service.php @@ -1487,4 +1487,4 @@ class Service implements \Box\InjectionAwareInterface return true; } -} \ No newline at end of file +}