Skip to content

Commit

Permalink
Merge pull request #183 from nobuhiko/fix#122
Browse files Browse the repository at this point in the history
fixed #122
  • Loading branch information
kiy0taka authored Mar 15, 2018
2 parents c77b857 + 98f822f commit 023b777
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions data/class/util/SC_Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,11 @@ public static function sfIsSuccess(SC_Session $objSess, $disp_error = true)
// TODO 警告表示させる?
// sfErrorHeader('>> referrerが無効になっています。');
} else {
$domain = SC_Utils_Ex::sfIsHTTPS() ? HTTPS_URL : HTTP_URL;
$pattern = sprintf('|^%s.*|', $domain);
$referer = $_SERVER['HTTP_REFERER'];
$domain = parse_url(HTTP_URL);
$referer = parse_url($_SERVER['HTTP_REFERER']);

// 管理画面から以外の遷移の場合はエラー画面を表示
if (!preg_match($pattern, $referer)) {
if ($domain['host'] !== $referer['host']) {
if ($disp_error) SC_Utils_Ex::sfDispError(INVALID_MOVE_ERRORR);
return false;
}
Expand Down

0 comments on commit 023b777

Please sign in to comment.