채택완료

그누보드 5.4 버전용 알림플러그인 ... 대댓글 작성시 오류가

PHP Version 7.2.26

그누보드 5.4.1.4

댓글내용 :  test   라고 짧게 내용을 입력했습니다.


에러발생 순서

게시글에 댓글을 작성합니다.

댓글1이 존재하고 그것에 다시 댓글을 적으면 오류 화면이 뜹니다.
├ 댓글1 <작성자: A>

│    │   <== 댓글1-1 이 있는 상태에서 <작성자K>가 댓글을 작성하면 에러 발생

│    └ 댓글1-1  <작성자: B>
├ 댓글2 <작성자: C>
└ 댓글3 <작성자: D>

 

플러그인 : https://sir.kr/g5_plugin/6259

 



Fatal error: Uncaught ArgumentCountError: Too few arguments to function cut_str(), 1 passed in /home/****/public_html/plugin/noti54/classes.php on line 762 and at least 2 expected in /home/****/public_html/lib/common.lib.php on line 1468


ArgumentCountError: Too few arguments to function cut_str(), 1 passed in /home/****/public_html/plugin/noti54/classes.php on line 762 and at least 2 expected in /home/****/public_html/lib/common.lib.php on line 1468

 

에러가 발생하는 762 줄의 내용은 다음과 같습니다.

parent_subject = '".sql_real_escape_string(cut_str(strip_tags($comment_wr['wr_content'])), 70)."',

 

@thisgun 님의 플러그인에도 댓글로 글을 적어놨으나,

이와 같은 현상을 겪거나 해결하신 분이 계신가 해서 QA에 글을 올립니다.

|

답변 1개 / 댓글 2개

채택된 답변
+20 포인트

cut_str  함수에 인자값이 문제인거 같은데 따로 에코 찍어서 디버깅 한번 해보시면 어떨까요

 

그리고 혹시 아래와 같이 되어야 하지 않을까요

 

cut_str(strip_tags($comment_wr['wr_content'])), 70

=>

 

cut_str(strip_tags($comment_wr['wr_content']), 70)

 

글을 70자 이내로 줄일려고 cut_str 함수를 쓰는거 같은데 ...

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

그렇게 변경하니 오류가 해결되었네요. 감사합니다.
수정전
parent_subject = '".sql_real_escape_string(cut_str(strip_tags($comment_wr['wr_content'])), 70)."',
parent_subject = '".
sql_real_escape_string
(
cut_str
(
strip_tags
(
$comment_wr['wr_content']
)
)
, 70
)
."',

수정후
parent_subject = '".sql_real_escape_string(cut_str(strip_tags($comment_wr['wr_content']), 70))."',
parent_subject = '".
sql_real_escape_string
(
cut_str
(
strip_tags
(
$comment_wr['wr_content']
)
, 70
)
)
."',

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고