Merge branch 'php81-jw'

This commit is contained in:
kjh
2022-05-31 07:38:17 +00:00
82 changed files with 452 additions and 502 deletions

View File

@ -348,7 +348,7 @@ function tln_getnxtag($body, $offset)
}
//intentional fall-through
case '>':
$attary{$attname} = '"yes"';
$attary[$attname] = '"yes"';
return array($tagname, $attary, $tagtype, $lt, $pos);
break;
default:
@ -382,7 +382,7 @@ function tln_getnxtag($body, $offset)
}
list($pos, $attval, $match) = $regary;
$pos++;
$attary{$attname} = '\'' . $attval . '\'';
$attary[$attname] = '\'' . $attval . '\'';
} elseif ($quot == '"') {
$regary = tln_findnxreg($body, $pos + 1, '\"');
if ($regary == false) {
@ -390,7 +390,7 @@ function tln_getnxtag($body, $offset)
}
list($pos, $attval, $match) = $regary;
$pos++;
$attary{$attname} = '"' . $attval . '"';
$attary[$attname] = '"' . $attval . '"';
} else {
/**
* These are hateful. Look for \s, or >.
@ -404,13 +404,13 @@ function tln_getnxtag($body, $offset)
* If it's ">" it will be caught at the top.
*/
$attval = preg_replace('/\"/s', '"', $attval);
$attary{$attname} = '"' . $attval . '"';
$attary[$attname] = '"' . $attval . '"';
}
} elseif (preg_match('|[\w/>]|', $char)) {
/**
* That was attribute type 4.
*/
$attary{$attname} = '"yes"';
$attary[$attname] = '"yes"';
} else {
/**
* An illegal character. Find next '>' and return.
@ -446,7 +446,7 @@ function tln_deent(&$attvalue, $regex, $hex = false)
if ($hex) {
$numval = hexdec($numval);
}
$repl{$matches[0][$i]} = chr($numval);
$repl[$matches[0][$i]] = chr($numval);
}
$attvalue = strtr($attvalue, $repl);
return true;
@ -528,7 +528,7 @@ function tln_fixatts(
if (preg_match($matchtag, $tagname)) {
foreach ($matchattrs as $matchattr) {
if (preg_match($matchattr, $attname)) {
unset($attary{$attname});
unset($attary[$attname]);
continue;
}
}
@ -541,7 +541,7 @@ function tln_fixatts(
tln_defang($attvalue);
if ($attname == 'style' && $attvalue !== $oldattvalue) {
$attvalue = "idiocy";
$attary{$attname} = $attvalue;
$attary[$attname] = $attvalue;
}
tln_unspace($attvalue);
@ -563,7 +563,7 @@ function tln_fixatts(
list($valmatch, $valrepl) = $valary;
$newvalue = preg_replace($valmatch, $valrepl, $attvalue);
if ($newvalue != $attvalue) {
$attary{$attname} = $newvalue;
$attary[$attname] = $newvalue;
$attvalue = $newvalue;
}
}
@ -572,14 +572,14 @@ function tln_fixatts(
}
if ($attname == 'style') {
if (preg_match('/[\0-\37\200-\377]+/', $attvalue)) {
$attary{$attname} = '"disallowed character"';
$attary[$attname] = '"disallowed character"';
}
preg_match_all("/url\s*\((.+)\)/si", $attvalue, $aMatch);
if (count($aMatch)) {
foreach($aMatch[1] as $sMatch) {
$urlvalue = $sMatch;
tln_fixurl($attname, $urlvalue, $trans_image_path, $block_external_images);
$attary{$attname} = str_replace($sMatch, $urlvalue, $attvalue);
$attary[$attname] = str_replace($sMatch, $urlvalue, $attvalue);
}
}
}
@ -671,7 +671,7 @@ function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images)
$bSucces = false;
$bEndTag = false;
for ($i=$pos,$iCount=strlen($body);$i<$iCount;++$i) {
$char = $body{$i};
$char = $body[$i];
switch ($char) {
case '<':
$sToken = $char;
@ -702,7 +702,7 @@ function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images)
case '!':
if ($sToken == '<') {
// possible comment
if (isset($body{$i+2}) && substr($body,$i,3) == '!--') {
if (isset($body[$i+2]) && substr($body,$i,3) == '!--') {
$i = strpos($body,'-->',$i+3);
if ($i === false) { // no end comment
$i = strlen($body);
@ -818,7 +818,7 @@ function tln_body2div($attary, $trans_image_path)
$styledef .= "color: $text; ";
}
if (strlen($styledef) > 0){
$divattary{"style"} = "\"$styledef\"";
$divattary["style"] = "\"$styledef\"";
}
}
return $divattary;
@ -914,10 +914,10 @@ function tln_sanitize(
if ($tagname == "body") {
$tagname = "div";
}
if (isset($open_tags{$tagname}) &&
$open_tags{$tagname} > 0
if (isset($open_tags[$tagname]) &&
$open_tags[$tagname] > 0
) {
$open_tags{$tagname}--;
$open_tags[$tagname]--;
} else {
$tagname = false;
}
@ -961,10 +961,10 @@ function tln_sanitize(
$attary = tln_body2div($attary, $trans_image_path);
}
if ($tagtype == 1) {
if (isset($open_tags{$tagname})) {
$open_tags{$tagname}++;
if (isset($open_tags[$tagname])) {
$open_tags[$tagname]++;
} else {
$open_tags{$tagname} = 1;
$open_tags[$tagname] = 1;
}
}
/**
@ -1121,19 +1121,19 @@ function HTMLFilter($body, $trans_image_path, $block_external_images = false)
if ($block_external_images) {
array_push(
$bad_attvals{'/.*/'}{'/^src|background/i'}[0],
$bad_attvals['/.*/']['/^src|background/i'][0],
'/^([\'\"])\s*https*:.*([\'\"])/si'
);
array_push(
$bad_attvals{'/.*/'}{'/^src|background/i'}[1],
$bad_attvals['/.*/']['/^src|background/i'][1],
"\\1$trans_image_path\\1"
);
array_push(
$bad_attvals{'/.*/'}{'/^style/i'}[0],
$bad_attvals['/.*/']['/^style/i'][0],
'/url\(([\'\"])\s*https*:.*([\'\"])\)/si'
);
array_push(
$bad_attvals{'/.*/'}{'/^style/i'}[1],
$bad_attvals['/.*/']['/^style/i'][1],
"url(\\1$trans_image_path\\1)"
);
}

View File

@ -1057,7 +1057,7 @@ class UploadHandler
}
if (count($failed_versions)) {
$file->error = $this->get_error_message('image_resize')
.' ('.implode($failed_versions,', ').')';
.' ('.implode(', ', $failed_versions).')';
}
// Free memory:
$this->destroy_image_object($file_path);

View File

@ -3801,7 +3801,7 @@ class HTMLPurifier_ElementDef
if (!empty($def->content_model)) {
$this->content_model =
str_replace("#SUPER", $this->content_model, $def->content_model);
str_replace("#SUPER", (string)$this->content_model, $def->content_model);
$this->child = false;
}
if (!empty($def->content_model_type)) {
@ -7555,7 +7555,7 @@ class HTMLPurifier_Length
if ($this->n === '0' && $this->unit === false) {
return true;
}
if (!ctype_lower($this->unit)) {
if ($this->unit === false || !ctype_lower($this->unit)) {
$this->unit = strtolower($this->unit);
}
if (!isset(HTMLPurifier_Length::$allowedUnits[$this->unit])) {
@ -7946,8 +7946,8 @@ class HTMLPurifier_Lexer
{
// normalize newlines to \n
if ($config->get('Core.NormalizeNewlines')) {
$html = str_replace("\r\n", "\n", $html);
$html = str_replace("\r", "\n", $html);
$html = str_replace("\r\n", "\n", (string)$html);
$html = str_replace("\r", "\n", (string)$html);
}
if ($config->get('HTML.Trusted')) {
@ -21914,11 +21914,11 @@ class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter
$string = $uri->toString();
// always available
$this->replace['%s'] = $string;
$this->replace['%r'] = $context->get('EmbeddedURI', true);
$token = $context->get('CurrentToken', true);
$this->replace['%n'] = $token ? $token->name : null;
$this->replace['%m'] = $context->get('CurrentAttr', true);
$this->replace['%p'] = $context->get('CurrentCSSProperty', true);
$this->replace['%r'] = $context->get('EmbeddedURI', true)?: '';
$token = $context->get('CurrentToken', true) ?: '';
$this->replace['%n'] = $token ? $token->name : '';
$this->replace['%m'] = $context->get('CurrentAttr', true) ?: '';
$this->replace['%p'] = $context->get('CurrentCSSProperty', true) ?: '';
// not always available
if ($this->secretKey) {
$this->replace['%t'] = hash_hmac("sha256", $string, $this->secretKey);

View File

@ -4410,7 +4410,7 @@ class HTML5TreeConstructer
foreach ($token['attr'] as $attr) {
if (!$el->hasAttribute($attr['name'])) {
$el->setAttribute($attr['name'], $attr['value']);
$el->setAttribute($attr['name'], (string)$attr['value']);
}
}

View File

@ -50,6 +50,22 @@ if ($_POST["resultCode"] === "0000") {
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
exit;
}
$md5_cert_no = md5($cert_no);
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
// 성인인증결과
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
set_session("ss_cert_type", $cert_type);
set_session("ss_cert_no", $md5_cert_no);
set_session("ss_cert_hash", $hash_data);
set_session("ss_cert_adult", $adult);
set_session("ss_cert_birth", $birth_day);
//set_session("ss_cert_sex", ($sex_code=="01"?"M":"F")); // 이니시스 간편인증은 성별정보 리턴 없음
set_session('ss_cert_dupinfo', $mb_dupinfo);
set_session('ss_cert_mb_id', $row['mb_id']);
} else {
// 인증실패 curl의 인증실패 체크
alert_close('코드 : '.$res_data['resultCode'].' '.urldecode($res_data['resultMsg']));

View File

@ -16,7 +16,7 @@ function make_mp3()
$mp3s[] = $file;
}
$ip = sprintf("%u", ip2long($_SERVER['REMOTE_ADDR']));
$ip = md5(sha1($_SERVER['REMOTE_ADDR']));
$mp3_file = 'cache/kcaptcha-'.$ip.'_'.G5_SERVER_TIME.'.mp3';
$contents = '';

View File

@ -159,7 +159,25 @@ if( $cert_enc_use == "Y" )
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
exit;
}
}else{
$mb_dupinfo = $md5_ci;
}
$md5_cert_no = md5($cert_no);
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
// 성인인증결과
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
set_session("ss_cert_type", $cert_type);
set_session("ss_cert_no", $md5_cert_no);
set_session("ss_cert_hash", $hash_data);
set_session("ss_cert_adult", $adult);
set_session("ss_cert_birth", $birth_day);
set_session("ss_cert_sex", ($sex_code=="01"?"M":"F")); // 이니시스 간편인증은 성별정보 리턴 없음
set_session('ss_cert_dupinfo', $mb_dupinfo);
set_session('ss_cert_mb_id', $row['mb_id']);
}
else if( $res_cd != "0000" )
{

View File

@ -136,8 +136,25 @@ if ($xpay->TX()) {
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
exit;
}
}else{
$mb_dupinfo = $md5_ci;
}
$md5_cert_no = md5($cert_no);
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
// 성인인증결과
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
set_session("ss_cert_type", $cert_type);
set_session("ss_cert_no", $md5_cert_no);
set_session("ss_cert_hash", $hash_data);
set_session("ss_cert_adult", $adult);
set_session("ss_cert_birth", $birth_day);
set_session("ss_cert_sex", $mb_sex); // 이니시스 간편인증은 성별정보 리턴 없음
set_session('ss_cert_dupinfo', $mb_dupinfo);
set_session('ss_cert_mb_id', $row['mb_id']);
} else {
//인증요청 결과 실패 DB처리
//echo "인증요청 결과 실패 DB처리하시기 바랍니다.<br>";

View File

@ -904,7 +904,7 @@ class XPayClient
*/
function StringToHex($MertKey)
{
$szKey;
$szKey = array();
$szMertKey = str_split($MertKey,2);
for ($i = 0 ; $i < 16 ; $i++)
{

View File

@ -121,8 +121,26 @@ if (empty($row['mb_id'])) { // ci로 등록된 계정이 없다면
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
exit;
}
}else{
$mb_dupinfo = $md5_ci;
}
$md5_cert_no = md5($cert_no);
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
// 성인인증결과
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
set_session("ss_cert_type", $cert_type);
set_session("ss_cert_no", $md5_cert_no);
set_session("ss_cert_hash", $hash_data);
set_session("ss_cert_adult", $adult);
set_session("ss_cert_birth", $birth_day);
set_session('ss_cert_sex', ($field[9] == 1 ? 'M' : 'F'));
set_session('ss_cert_dupinfo', $mb_dupinfo);
set_session('ss_cert_mb_id', $row['mb_id']);
$g5['title'] = 'KCB 휴대폰 본인확인';
include_once(G5_PATH.'/head.sub.php');
?>

View File

@ -95,7 +95,26 @@ if (empty($row['mb_id'])) { // ci로 등록된 계정이 없다면
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
exit;
}
}else{
$mb_dupinfo = $md5_ci;
}
$md5_cert_no = md5($cert_no);
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
// 성인인증결과
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
set_session("ss_cert_type", $cert_type);
set_session("ss_cert_no", $md5_cert_no);
set_session("ss_cert_hash", $hash_data);
set_session("ss_cert_adult", $adult);
set_session("ss_cert_birth", $birth_day);
set_session('ss_cert_sex', ($field[9] == 1 ? 'M' : 'F'));
set_session('ss_cert_dupinfo', $mb_dupinfo);
set_session('ss_cert_mb_id', $row['mb_id']);
$g5['title'] = 'KCB 아이핀 본인확인';
include_once(G5_PATH.'/head.sub.php');
?>

View File

@ -151,15 +151,15 @@ if($config['cf_sms_type'] == 'LMS') {
include_once(G5_LIB_PATH.'/icode.lms.lib.php');
class SMS5 extends LMS {
var $icode_id;
var $icode_pw;
var $socket_host;
var $socket_port;
var $socket_portcode;
var $send_type;
var $Data = array();
var $Result = array();
var $Log = array();
public $icode_id;
public $icode_pw;
public $socket_host;
public $socket_port;
public $socket_portcode;
public $send_type;
public $Data = array();
public $Result = array();
public $Log = array();
function Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate="", $nCount) {
global $config;
@ -242,7 +242,7 @@ if($config['cf_sms_type'] == 'LMS') {
function CheckCommonTypeDate($strDate) {
$strDate=preg_replace("/[^0-9]/","",$strDate);
if ($strDate) {
if (!checkdate(substr($strDate,4,2),substr($strDate,6,2),substr($rsvTime,0,4))) return "예약날짜가 잘못되었습니다";
if (!checkdate(substr($strDate,4,2),substr($strDate,6,2),substr($strDate,0,4))) return "예약날짜가 잘못되었습니다";
if (substr($strDate,8,2)>23 || substr($strDate,10,2)>59) return "예약시간이 잘못되었습니다";
}
}
@ -427,10 +427,6 @@ if($config['cf_sms_type'] == 'LMS') {
if (!$fsocket) return false;
set_time_limit(300);
## php4.3.10일경우
## zend 최신버전으로 업해주세요..
## 또는 69번째 줄을 $this->Data as $tmp => $puts 로 변경해 주세요.
foreach($this->Data as $puts) {
$dest = substr($puts,26,11);
fputs($fsocket, $puts);