1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-25 00:41:52 +02:00

Issue #5205 - Creation of urls with custom domain setting when using 'full' mode.

This commit is contained in:
camer0n
2024-03-12 16:32:01 -07:00
parent 65399f78c4
commit 868e6a42c4
3 changed files with 16 additions and 1 deletions

View File

@@ -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')
{

View File

@@ -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;
}

View File

@@ -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');
}