diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 814049140..46a714209 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -4348,7 +4348,8 @@ class e107 if ($options['mode'] === 'full') { - $sefUrl = SITEURL . $rawUrl; + $siteURL = !empty($tmp[$plugin][$key]['domain']) ? 'https://'.rtrim($tmp[$plugin][$key]['domain'],'/').'/' : SITEURL; + $sefUrl = $siteURL . $rawUrl; } elseif ($options['mode'] === 'raw') { diff --git a/e107_plugins/_blank/e_url.php b/e107_plugins/_blank/e_url.php index e6f19fbe1..2c0d9f67b 100644 --- a/e107_plugins/_blank/e_url.php +++ b/e107_plugins/_blank/e_url.php @@ -41,6 +41,14 @@ class _blank_url // plugin-folder + '_url' ); + $config['parked'] = array( + 'domain' => 'parked-domain.com', + 'regex' => '^custom/?$', // matched against url, and if true, redirected to 'redirect' below. + 'sef' => 'custom', // used by e107::url(); to create a url from the db table. + 'redirect' => '{e_PLUGIN}_blank/blank.php?custom=1', // file-path of what to load when the regex returns true. + + ); + return $config; } diff --git a/e107_tests/tests/unit/e107Test.php b/e107_tests/tests/unit/e107Test.php index 634fe9bef..3efcee2e0 100644 --- a/e107_tests/tests/unit/e107Test.php +++ b/e107_tests/tests/unit/e107Test.php @@ -1566,6 +1566,12 @@ class e107Test extends \Codeception\Test\Unit // $this->assertEquals("https://localhost/e107/news", $result); } + // e107 v2.4 - test for custom domain + e107::getPlugin()->install('_blank'); + $result = $obj::url('_blank', 'parked',null,['mode'=>'full']); + self::assertSame('https://parked-domain.com/custom', $result); + e107::getPlugin()->uninstall('_blank'); + }