Definition at line 13 of file UrlCheck.php.
◆ __construct()
__construct |
( |
UrlValidator |
$urlValidator | ) |
|
- Parameters
-
UrlValidator | $urlValidator | |
Definition at line 23 of file UrlCheck.php.
25 $this->urlValidator = $urlValidator;
◆ indexAction()
Validate URL
- Returns
- JsonModel
Definition at line 33 of file UrlCheck.php.
35 $params = Json::decode($this->getRequest()->getContent(), Json::TYPE_ARRAY);
36 $result = [
'successUrl' =>
false,
'successSecureUrl' =>
true];
38 $hasBaseUrl = isset(
$params[
'address'][
'actual_base_url']);
39 $hasSecureBaseUrl = isset(
$params[
'https'][
'text']);
40 $hasSecureAdminUrl = !empty(
$params[
'https'][
'admin']);
41 $hasSecureFrontUrl = !empty(
$params[
'https'][
'front']);
42 $schemes = [
'http',
'https'];
45 if ($hasBaseUrl && $this->urlValidator->isValid(
$params[
'address'][
'actual_base_url'], $schemes)) {
50 if ($hasSecureAdminUrl || $hasSecureFrontUrl) {
51 if (!($hasSecureBaseUrl && $this->urlValidator->isValid(
$params[
'https'][
'text'], $schemes))) {
52 $result[
'successSecureUrl'] =
false;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/setup/src/Magento/Setup/Controller/UrlCheck.php