Skip to content

Commit a6e302f

Browse files
committedJul 26, 2022
KCAPTCHA php5.3 버전 이하에서 나는 오류 수정
1 parent 0c275d0 commit a6e302f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
 

‎plugin/kcaptcha/kcaptcha.lib.php

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
class KCAPTCHA{
2020

21+
private $keystring;
22+
2123
// generates keystring and image
2224
function image(){
2325
require(dirname(__FILE__).'/kcaptcha_config.php');

‎plugin/kcaptcha/kcaptcha_image.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44

55
$captcha = new KCAPTCHA();
66
$ss_captcha_key = get_session("ss_captcha_key");
7+
$ss_captcha_key_decrypt = '';
78
if( $ss_captcha_key && !preg_match('/^[0-9]/', $ss_captcha_key) && function_exists('get_string_decrypt') ){
89
$ip = md5(sha1($_SERVER['REMOTE_ADDR']));
9-
$ss_captcha_key = str_replace($ip, '', get_string_decrypt($ss_captcha_key));
10+
$ss_captcha_key_decrypt = str_replace($ip, '', get_string_decrypt($ss_captcha_key));
1011
}
11-
$captcha->setKeyString($ss_captcha_key);
12+
# php 5.2 또는 5.3 버전에서 포인터처럼 해당 세션값이 변경되는 버그가 있어서 아래와 같이 조치함
13+
if(! $ss_captcha_key_decrypt) $ss_captcha_key_decrypt = $ss_captcha_key;
14+
$captcha->setKeyString($ss_captcha_key_decrypt);
1215
$captcha->getKeyString();
1316
$captcha->image();

0 commit comments

Comments
 (0)
Please sign in to comment.