From ffb3cb7fd86f622f2d7f4a4c01eeab5a597ea376 Mon Sep 17 00:00:00 2001 From: thisgun Date: Thu, 18 Jan 2018 10:33:37 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=BC=EB=B6=80=20=EC=86=8C=EC=85=9C=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=86=8C=EC=8A=A4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/social/includes/functions.php | 7 +++++++ plugin/social/register_member_update.php | 15 +++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/plugin/social/includes/functions.php b/plugin/social/includes/functions.php index 6f71eecc2..ed06441ec 100644 --- a/plugin/social/includes/functions.php +++ b/plugin/social/includes/functions.php @@ -327,6 +327,9 @@ function social_extends_get_keys($provider){ "keys" => array("id" => $config['cf_google_clientid'], "secret" => $config['cf_google_secret']), "redirect_uri" => get_social_callbackurl('google'), + "scope" => "https://www.googleapis.com/auth/plus.login ". // optional + "https://www.googleapis.com/auth/plus.me ". // optional + "https://www.googleapis.com/auth/plus.profile.emails.read", // optional //"access_type" => "offline", // optional //"approval_prompt" => "force", // optional ); @@ -470,6 +473,10 @@ function social_check_login_before($p_service=''){ // then grab the user profile $user_profile = $adapter->getUserProfile(); + if( ! (isset($_SESSION['sl_userprofile']) && is_array($_SESSION['sl_userprofile'])) ){ + $_SESSION['sl_userprofile'] = array(); + } + if( ! $is_member ){ $_SESSION['sl_userprofile'][$provider_name] = json_encode( $user_profile ); } diff --git a/plugin/social/register_member_update.php b/plugin/social/register_member_update.php index 0d10211f3..2fbec2f98 100644 --- a/plugin/social/register_member_update.php +++ b/plugin/social/register_member_update.php @@ -29,12 +29,15 @@ $mb_email = trim($_POST['mb_email']); $mb_name = clean_xss_tags(trim(strip_tags($_POST['mb_name']))); $mb_email = get_email_address($mb_email); -if( function_exists('filter_var') ){ - $mb_nick = filter_var($mb_nick, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH); - $mb_name = filter_var($mb_name, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH); -} else { - $mb_nick = sql_real_escape_string($mb_nick); - $mb_name = sql_real_escape_string($mb_name); +// 이름, 닉네임에 utf-8 이외의 문자가 포함됐다면 오류 +// 서버환경에 따라 정상적으로 체크되지 않을 수 있음. +$tmp_mb_name = iconv('UTF-8', 'UTF-8//IGNORE', $mb_name); +if($tmp_mb_name != $mb_name) { + $mb_name = $tmp_mb_name; +} +$tmp_mb_nick = iconv('UTF-8', 'UTF-8//IGNORE', $mb_nick); +if($tmp_mb_nick != $mb_nick) { + $mb_nick = $tmp_mb_nick; } if( ! $mb_nick || ! $mb_name ){