getRelativeUrl() === '' || $url->isExternal()) { $this->_error('IS_EXTERNAL'); return false; } return true; } /** * {@inheritdoc} */ protected function _error($messageKey, $value = null) { if ($messageKey === 'IS_EXTERNAL') { $this->_messages[$messageKey] = t('The url must not be external.'); } else { parent::_error($messageKey, $value); } } }