Pie Register 에서 설정에서 설정값 다국어 지원 - 한글이 깨지는 문제 해결방법

pie-register.php 소스에 다음과 같이 수정하면 설정화면에서 다국어로 설적값을 저장해도 글자가 깨지지 않는다.

owl 2013-01-04 23.02.43

변경전

function SaveSettings(){
	check_admin_referer('piereg-update-options');
	$update = array();
	$update = get_option( 'pie_register' );
	$custom = get_option( 'pie_register_custom' );
	$update["paypal_option"] = $this->disable_magic_quotes_gpc($_POST['piereg_paypal_option']);
	if(isset($_POST['payment_gateway_page'])){
	$update["paypal_butt_id"] = $this->disable_magic_quotes_gpc($_POST['piereg_paypal_butt_id']);
	$update["paypal_pdt"] = $this->disable_magic_quotes_gpc($_POST['piereg_paypal_pdt']);
	}
	if(isset($_POST['email_notification_page'])){
	
	$update['html'] = $this->disable_magic_quotes_gpc($_POST['piereg_html']);
	$update['from'] = $this->disable_magic_quotes_gpc($_POST['piereg_from']);
	$update['fromname'] = $this->disable_magic_quotes_gpc($_POST['piereg_fromname']);
	$update['subject'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_subject']));
	$update['custom_msg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_custom_msg']));
	$update['user_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_user_nl2br']));
	$update['user_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_emailvmsguser_nl2br']));
	$update['user_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminvmsguser_nl2br']));
	$update['msg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_msg']));
	$update['adminvmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminvmsg']));
	$update['emailvmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_emailvmsg']));
	$update['disable_admin'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_disable_admin']));
	$update['adminhtml'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminhtml']));
	$update['adminfrom'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminfrom']));
	$update['adminfromname'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminfromname']));
	$update['adminsubject'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminsubject']));
	$update['custom_adminmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_custom_adminmsg']));
	$update['admin_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_admin_nl2br']));
	$update['adminmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminmsg']));
	}
	if(isset($_POST['presentation_page'])){
	$update['register_css'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_register_css']));
	$update['login_css'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_login_css']));
	}

변경후

function SaveSettings(){
	check_admin_referer('piereg-update-options');
	$update = array();
	$update = get_option( 'pie_register' );
	$custom = get_option( 'pie_register_custom' );
	$update["paypal_option"] = $this->disable_magic_quotes_gpc($_POST['piereg_paypal_option']);
	if(isset($_POST['payment_gateway_page'])){
	$update["paypal_butt_id"] = $this->disable_magic_quotes_gpc($_POST['piereg_paypal_butt_id']);
	$update["paypal_pdt"] = $this->disable_magic_quotes_gpc($_POST['piereg_paypal_pdt']);
	}
	if(isset($_POST['email_notification_page'])){
	
	$update['html'] = $this->disable_magic_quotes_gpc($_POST['piereg_html']);
	$update['from'] = $this->disable_magic_quotes_gpc($_POST['piereg_from']);
	$update['fromname'] = $this->disable_magic_quotes_gpc($_POST['piereg_fromname']);
	$update['subject'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_subject'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['custom_msg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_custom_msg'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['user_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_user_nl2br'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['user_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_emailvmsguser_nl2br'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['user_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminvmsguser_nl2br'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['msg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_msg'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['adminvmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminvmsg'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['emailvmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_emailvmsg'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['disable_admin'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_disable_admin'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['adminhtml'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminhtml'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['adminfrom'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminfrom'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['adminfromname'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminfromname'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['adminsubject'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminsubject'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['custom_adminmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_custom_adminmsg'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['admin_nl2br'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_admin_nl2br'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['adminmsg'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_adminmsg'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	}
	if(isset($_POST['presentation_page'])){
	$update['register_css'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_register_css'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	$update['login_css'] = $this->disable_magic_quotes_gpc(htmlentities($_POST['piereg_login_css'], ENT_QUOTES | ENT_IGNORE, "UTF-8"));
	}