Is there an easy way to remove with php
PHP HTML 형식의 이벤트 HTML입니다. 이벤트 예 : 제출, mouseOut, mouseOver, click, blur, focus, etc. 자바 스크립트 삽입을 막기 위해 다음과 같은 경우가 있습니다 : 이 있습니다 을 PHP으로 제거하는 쉬운 방법은 PHP srtring의 모든 이벤트 유형입니다. 이벤트 예 : 제출, mouseOut, mouseOver, click, blur, focus, etc. 다음과 같은 경우에, 자바 스크립트 주입을 방지하기 위해 :문자열에서 이벤트 자바 스크립트를 모두 삭제합니다.
$text= 'mi secure html <div id="javascript_injection" onfocus=function(){SomeJavaScriptCode}></div> <p> Im interested in showing the resulting html </p>'
echo $text = 'mi secure html <div id="javascript_injection" > example </div> <b> Im interested in showing the resulting html </b>
나는이 보여주는에 관심이 있어요 :
'mi secure html <div id="javascript_injection" > example </div> <b> Im interested in showing the resulting html </b>
PD : 나는 모든 텍스트를 탈출하거나 모든 태그를 제거 할 수 있기 때문에이 내가 html로 보여주고 싶은 부분이다. Imagine you want to show a user creates html to another and want to avoid the injection of javascript
이 될 무슨 뜻입니까? PHP? 자바 스크립트? HTML? – Amberlamps
코드가 자바 스크립트를 통해 "해킹"될 수 있다면 코드를 더 잘 변경하십시오. – Peon
죄송합니다. 질문에 답변했을 때 편집 중입니다. 다시 게시하십시오. 굵은 글씨체에주의하십시오. – Martin