Changeset 15314 for branches/rel


Ignore:
Timestamp:
2007/08/20 17:49:32 (17 years ago)
Author:
adachi
Message:

ログインできない問題の修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel/html/frontparts/login_check.php

    r15071 r15314  
    3434        $objCookie->setCookie('login_email', ''); 
    3535    } 
    36      
     36 
    3737    if(count($arrErr) == 0) { 
    3838        if($objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'])) { 
     
    4343            $where = "email ILIKE ? AND status = 1 AND del_flg = 0"; 
    4444            $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'])); 
    45              
     45 
    4646            if($ret > 0) { 
    4747                sfDispSiteError(TEMP_LOGIN_ERROR); 
     
    6464        header("Location: /mypage/login.php"); 
    6565    }else{ 
    66         header("Location: " . $_POST['url']);    
     66        header("Location: " . $_POST['url']); 
    6767    } 
    6868    exit; 
     
    8181/* POST¤µ¤ì¤ëURL¤Î¥Á¥§¥Ã¥¯*/ 
    8282function lfIsValidURL() { 
    83     $site_url  = sfIsHTTPS() ? SSL_URL : SITE_URL; 
    84     $check_url = trim($_POST['url']); 
     83    $arrValidUrl = array(SSL_URL, SITE_URL, '/'); 
     84    $targetUrl   = $_POST['url']; 
    8585 
    86     // ¥í¡¼¥«¥ë¥É¥á¥¤¥ó¥Á¥§¥Ã¥¯ 
    87     if (!preg_match("|^$site_url|", $check_url) && !preg_match("|^/|", $check_url)) { 
     86    // $arrValidUrl¤Ë¥Þ¥Ã¥Á¤·¤Ê¤¤¾ì¹ç¤ÏÉÔÀµ¤ÊURL 
     87    $match = false; 
     88    foreach ($arrValidUrl as $validUrl) { 
     89        $pattern = sprintf('/^%s/' , preg_quote($validUrl, '/')); 
     90        gfPrintLog($pattern . ':' . $targetUrl); 
     91        if ( preg_match($pattern, $targetUrl) ) { 
     92            $match = true; 
     93            break; 
     94        } 
     95    } 
     96    if (!$match) return false; 
     97 
     98    // ²þ¹Ô¥³¡¼¥É(CR¡¦LF)¡¦NULL¥Ð¥¤¥È¤ò´Þ¤à¾ì¹ç¤ÏÉÔÀµ¤ÊURL 
     99    $pattern = '/\r|\n|\0|%0D|%0A|%00/'; 
     100    if (preg_match_all($pattern, $targetUrl, $matches)) { 
    88101        return false; 
    89102    } 
    90      
    91     // ²þ¹Ô¥³¡¼¥É(CR¡¦LF)¡¦NULL¥Ð¥¤¥È¥Á¥§¥Ã¥¯ 
    92     $pattern = '/\r|\n|\0|%0D|%0A|%00/'; 
    93     if (preg_match_all($pattern, $check_url, $matches) > 0) { 
    94         return false; 
    95     } 
    96      
     103 
    97104    return true; 
    98105} 
Note: See TracChangeset for help on using the changeset viewer.