url) || UrlHelper::externalIsLocal($this->url, $this->getBaseURL())) { return [ 'command' => 'openModalDialogWithUrl', 'url' => $this->url, 'dialogOptions' => $this->settings, ]; } throw new \LogicException('External URLs are not allowed.'); } /** * Gets the complete base URL. */ private function getBaseUrl() { $requestContext = \Drupal::service('router.request_context'); return $requestContext->getCompleteBaseUrl(); } }