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

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

QA

그누보드 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)."',

 

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

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

이 질문에 댓글 쓰기 :

답변 1

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

 

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

 

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

=>

 

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

 

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

수정전
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
            )
      )
."',

답변을 작성하시기 전에 로그인 해주세요.
전체 399
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT