InternalUrlValidator.php (icingaweb2-2.11.3) | : | InternalUrlValidator.php (icingaweb2-2.11.4) | ||
---|---|---|---|---|
skipping to change at line 21 | skipping to change at line 21 | |||
* Validator that checks whether a textfield doesn't contain an external URL | * Validator that checks whether a textfield doesn't contain an external URL | |||
*/ | */ | |||
class InternalUrlValidator extends Zend_Validate_Abstract | class InternalUrlValidator extends Zend_Validate_Abstract | |||
{ | { | |||
/** | /** | |||
* {@inheritdoc} | * {@inheritdoc} | |||
*/ | */ | |||
public function isValid($value) | public function isValid($value) | |||
{ | { | |||
$url = Url::fromPath($value); | $url = Url::fromPath($value); | |||
if ($url->getRelativeUrl() === '' || $url->getScheme() !== Icinga::app() ->getRequest()->getScheme()) { | if ($url->getRelativeUrl() === '' || $url->isExternal()) { | |||
$this->_error('IS_EXTERNAL'); | $this->_error('IS_EXTERNAL'); | |||
return false; | return false; | |||
} | } | |||
return true; | return true; | |||
} | } | |||
/** | /** | |||
* {@inheritdoc} | * {@inheritdoc} | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |