mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Eliminate redundant redirect through redirect.html
This commit is contained in:
parent
4b81e32e22
commit
892aa58540
1 changed files with 12 additions and 6 deletions
|
|
@ -39,8 +39,9 @@ class VirtualXMLDisplayHandler
|
|||
}
|
||||
|
||||
$html = array();
|
||||
$html[] = '<script type="text/javascript">';
|
||||
$html[] = '//<![CDATA[';
|
||||
$html[] = '<html>';
|
||||
$html[] = '<head>';
|
||||
$html[] = '<script>';
|
||||
|
||||
if($output->message)
|
||||
{
|
||||
|
|
@ -49,12 +50,17 @@ class VirtualXMLDisplayHandler
|
|||
|
||||
if($output->url)
|
||||
{
|
||||
$url = preg_replace('/#(.+)$/', '', $output->url);
|
||||
$html[] = 'self.location.href = "' . $request_url . 'common/tpl/redirect.html?redirect_url=' . urlencode($url) . '";';
|
||||
$output->url = preg_replace('/#(.+)$/', '', $output->url);
|
||||
$html[] = 'if (opener) {';
|
||||
$html[] = ' opener.location.href = ' . json_encode($output->url) . ';';
|
||||
$html[] = '} else {';
|
||||
$html[] = ' parent.location.href = ' . json_encode($output->url) . ';';
|
||||
$html[] = '}';
|
||||
}
|
||||
$html[] = '//]]>';
|
||||
|
||||
$html[] = '</script>';
|
||||
|
||||
$html[] = '</head><body></body></html>';
|
||||
|
||||
return join(PHP_EOL, $html);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue