Skip to content

Commit

Permalink
fix #2069 XEVE-17-014 redirect 문제 고침
Browse files Browse the repository at this point in the history
  • Loading branch information
bnu committed Apr 14, 2017
1 parent df678ea commit aff52d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 50 deletions.
34 changes: 11 additions & 23 deletions classes/display/VirtualXMLDisplayHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,32 @@ function toDoc(&$oModule)

if($error === 0)
{
if($message != 'success')
{
$output->message = $message;
}
if($message != 'success') $output->message = $message;

if($redirect_url)
{
$output->url = $redirect_url;
}
else
{
$output->url = $request_uri;
}
$output->url = ($redirect_url) ? $redirect_url : $request_uri;
}
else
{
if($message != 'fail')
{
$output->message = $message;
}
if($message != 'fail') $output->message = $message;
}

$html = array();
$html[] = '<script type="text/javascript">';
$html[] = '//<![CDATA[';
$html[] = '<!DOCTYPE html><html><head><title>Moved...</title><meta charset="utf-8" /><script>';

if($output->message)
{
$html[] = 'alert("' . $output->message . '");';
$html[] = 'alert(' . json_encode($output->message, JSON_UNESCAPED_SLASHES) . ');';
}

if($output->url)
{
$url = preg_replace('/#(.+)$/i', '', $output->url);
$html[] = 'self.location.href = "' . $request_url . 'common/tpl/redirect.html?redirect_url=' . urlencode($url) . '";';
$url = json_encode(preg_replace('/#(.+)$/i', '', $output->url), JSON_UNESCAPED_SLASHES);
$html[] = 'var win = (window.opener) ? window.opener : window.parent;';
$html[] = 'win.location.href = ' . $url;
$html[] = 'if(window.opener) self.close();';
}
$html[] = '//]]>';
$html[] = '</script>';

$html[] = '</script></head></html>';

return join(PHP_EOL, $html);
}
Expand Down
27 changes: 0 additions & 27 deletions common/tpl/redirect.html

This file was deleted.

0 comments on commit aff52d1

Please sign in to comment.