mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 13:02:15 +09:00
Support HTTP status codes 301, 302, 303, 307, 308 when setting redirect URL
This commit is contained in:
parent
46dbf0be99
commit
7367ad2645
1 changed files with 11 additions and 1 deletions
|
|
@ -1005,7 +1005,17 @@ class ModuleHandler extends Handler
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
header('location: ' . $oModule->getRedirectUrl());
|
if (in_array($oModule->getHttpStatusCode(), [301, 303, 307, 308]))
|
||||||
|
{
|
||||||
|
self::_setHttpStatusMessage($oModule->getHttpStatusCode());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self::_setHttpStatusMessage(302);
|
||||||
|
}
|
||||||
|
header(sprintf('HTTP/1.1 %d %s', Context::get('http_status_code'), Context::get('http_status_message')));
|
||||||
|
header(sprintf('Location: %s', $oModule->getRedirectUrl()));
|
||||||
|
Context::setCacheControl(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue