Kboard 게시판 설정 페이지 접속 오류 문의

1. 정확한 제품 또는 플러그인 이름

- KBoard 게시판 6.3

- User Role Editor Pro 4.61

 

2. 상세 내용

Kboard 플러그인을 User Role Editor 플러그인과 같이 사용중입니다.
https://imgur.com/W8NZwjB
그런데 종종 Kboard 게시판 설정 페이지로 들어가려 하면 HTTP 500 오류가 발생될 때가 있습니다.
이럴 때 웹 서버에서 로그를 보면 아래와 같은 로그들이 기록됩니다.
(아래 로그는 한번에 기록된 것은 아니며, 오류나는 라인마다 순차적으로 "./plugins/kboard/pages/kboard_setting.php" 코드를 수정하며 기록된 내용입니다.)

[Thu Apr 13 11:09:32.381390 2023] [proxy_fcgi:error] [pid 17721:tid 140468453357312] [remote 211.x.x.30:43867] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php:471\nStack trace:\n#0 /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php(471): in_array()\n#1 /home/WWW/docroot/wp-content/plugins/kboard/index.php(390): include_once('...')\n#2 /home/WWW/docroot/wp-content/plugins/kboard/index.php(335): kboard_setting()\n#3 /home/WWW/docroot/wp-includes/class-wp-hook.php(308): kboard_list()\n#4 /home/WWW/docroot/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#5 /home/WWW/docroot/wp-includes/plugin.php(517): WP_Hook->do_action()\n#6 /home/WWW/docroot/wp-admin/admin.php(259): do_action()\n#7 {main}\n  thrown in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php on line 471', referer: https://site.ac.kr/wp-admin/admin.php?page=kboard_list

[Thu Apr 13 11:10:28.628829 2023] [proxy_fcgi:error] [pid 17721:tid 140468436571904] [remote 211.x.x.30:45124] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php:502\nStack trace:\n#0 /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php(502): in_array()\n#1 /home/WWW/docroot/wp-content/plugins/kboard/index.php(390): include_once('...')\n#2 /home/WWW/docroot/wp-content/plugins/kboard/index.php(335): kboard_setting()\n#3 /home/WWW/docroot/wp-includes/class-wp-hook.php(308): kboard_list()\n#4 /home/WWW/docroot/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#5 /home/WWW/docroot/wp-includes/plugin.php(517): WP_Hook->do_action()\n#6 /home/WWW/docroot/wp-admin/admin.php(259): do_action()\n#7 {main}\n  thrown in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php on line 502', referer: https://site.ac.kr/wp-admin/admin.php?page=kboard_list

[Thu Apr 13 11:11:13.217185 2023] [proxy_fcgi:error] [pid 17721:tid 140467995842304] [remote 211.x.x.30:40817] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php:592\nStack trace:\n#0 /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php(592): in_array()\n#1 /home/WWW/docroot/wp-content/plugins/kboard/index.php(390): include_once('...')\n#2 /home/WWW/docroot/wp-content/plugins/kboard/index.php(335): kboard_setting()\n#3 /home/WWW/docroot/wp-includes/class-wp-hook.php(308): kboard_list()\n#4 /home/WWW/docroot/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#5 /home/WWW/docroot/wp-includes/plugin.php(517): WP_Hook->do_action()\n#6 /home/WWW/docroot/wp-admin/admin.php(259): do_action()\n#7 {main}\n  thrown in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php on line 592', referer: https://site.ac.kr/wp-admin/admin.php?page=kboard_list

[Thu Apr 13 11:12:07.234887 2023] [proxy_fcgi:error] [pid 17721:tid 140468394608384] [remote 211.x.x.30:49701] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php:616\nStack trace:\n#0 /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php(616): in_array()\n#1 /home/WWW/docroot/wp-content/plugins/kboard/index.php(390): include_once('...')\n#2 /home/WWW/docroot/wp-content/plugins/kboard/index.php(335): kboard_setting()\n#3 /home/WWW/docroot/wp-includes/class-wp-hook.php(308): kboard_list()\n#4 /home/WWW/docroot/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#5 /home/WWW/docroot/wp-includes/plugin.php(517): WP_Hook->do_action()\n#6 /home/WWW/docroot/wp-admin/admin.php(259): do_action()\n#7 {main}\n  thrown in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php on line 616', referer: https://site.ac.kr/wp-admin/admin.php?page=kboard_list

[Thu Apr 13 11:12:48.236774 2023] [proxy_fcgi:error] [pid 17540:tid 140468470142720] [remote 211.x.x.30:44037] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php:643\nStack trace:\n#0 /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php(643): in_array()\n#1 /home/WWW/docroot/wp-content/plugins/kboard/index.php(390): include_once('...')\n#2 /home/WWW/docroot/wp-content/plugins/kboard/index.php(335): kboard_setting()\n#3 /home/WWW/docroot/wp-includes/class-wp-hook.php(308): kboard_list()\n#4 /home/WWW/docroot/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#5 /home/WWW/docroot/wp-includes/plugin.php(517): WP_Hook->do_action()\n#6 /home/WWW/docroot/wp-admin/admin.php(259): do_action()\n#7 {main}\n  thrown in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php on line 643', referer: https://site.ac.kr/wp-admin/admin.php?page=kboard_list

[Thu Apr 13 11:13:13.513040 2023] [proxy_fcgi:error] [pid 17540:tid 140468386215680] [remote 211.x.x.30:39863] AH01071: Got error 'PHP message: PHP Warning:  Undefined array key "roles" in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php on line 1240PHP message: PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php:1240\nStack trace:\n#0 /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php(1240): in_array()\n#1 /home/WWW/docroot/wp-content/plugins/kboard/index.php(390): include_once('...')\n#2 /home/WWW/docroot/wp-content/plugins/kboard/index.php(335): kboard_setting()\n#3 /home/WWW/docroot/wp-includes/class-wp-hook.php(308): kboard_list()\n#4 /home/WWW/docroot/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#5 /home/WWW/docroot/wp-includes/plugin.php(517): WP_Hook->do_action()\n#6 /home/WWW/docroot/wp-admin/admin.php(259): do_action()\n#7 {main}\n  thrown in /home/WWW/docroot/wp-content/plugins/kboard/pages/kboard_setting.php on line 1240', referer: https://site.ac.kr/wp-admin/admin.php?page=kboard_list

 

3. 확인 가능한 상세 페이지 주소

- 사이트 보안상 웹사이트를 공개할수 없어 위 로그에도 사이트 주소 및 접속 IP 주소를 임의로 변경했습니다.

 

4. 수정한 코드 내역 (있다면)

위 로그에 기록된 line 471, 502, 592, 616, 643, 1240 행 마다 순차적으로 아래 예시와 같은 식으로
"./plugins/kboard/pages/kboard_setting.php" 코드를 수정하여 게시판 설정 페이지에 500 오류 없이 들어갈 수 있었습니다.

- "line 471"인 경우 수정한 코드 예시
  원본: <?php if($key=='administrator' || in_array($key, $read_roles)):?>

  수정: <?php if($key=='administrator' || in_array($key, $read_roles ? $read_roles:[])):?>

- "line 1240"인 경우 수정한 코드 예시
  원본: <?php if($roles_key=='administrator' || in_array($roles_key, $item['roles'])):?>

  수정: <?php if($roles_key=='administrator' || in_array($roles_key, isset($item['roles']) ? $item['roles']:[])):?>


위와같이 수정하여 게시판 설정에 들어간 후, (아무런 변경없이)설정된 게시판 내용을 한번 저장을 해 주고나면,
위에 수정한 코드를 Kboard 배포 원본 코드로 롤백해도 이후로는 500 오류는 안 생깁니다.
이런 경험을 벌써 여러차례 하고 있는데요... 게시판 권한 설정 후 저장시 뭔가 꼬이면 이러한 오류가 발생되는 것 같아서 개선조치가 필요해 보입니다.

감사합니다.
 

 

좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
워드프레스 에러 기술지원 서비스 전문가에게 맡기세요