>  기사  >  백엔드 개발  >  ecshop 수정자 preg_replace/e에 대한 몇 가지 안전하지 않은 변경 사항

ecshop 수정자 preg_replace/e에 대한 몇 가지 안전하지 않은 변경 사항

WBOY
WBOY원래의
2016-08-08 09:20:30765검색
주로 upload/includes/cls_template.php 파일에 집중: 1: 300행: 원문: return preg_replace("/{([^}{n]*)}/e", "$this->select('\1');", $source); 다음으로 수정: return preg_replace_callback("/{([^}{n]*)}/", function($r) { return $this->select($r[1] ); }, $source); 2: 495행: 원문: $out = "< ?php n" . '$k = ' . preg_replace("/('\$[^,]+)/e" , "stripslashes(trim('\1','''));", var_export($t, true)) . ";n"; 다음으로 수정됨: $replacement = preg_replace_callback("/('\$[^,] +)/" ,                                                          스트립슬래시 반환(trim($matcher[1],'''));                                                   ,                     var_export($t, true));                     n"; 3: 554행: //zuimoban.com URL 없이 재인쇄, 나무JJ 원문: $val = preg_replace("/[([^[]]*)]/eis " , "'.'.str_replace('$','$','\1')", $val); 수정: $val = preg_replace_callback("/[([^[]]*)]/is", 함수($matcher) { return '.' .str_replace('$','$',$matcher[1]);                                , $val); 4: 1071행: 원문: $replacement = "'{include file='.strtolower('\1'). '}'"; $source = preg_replace($pattern, $replacement, $ source); 수정: $source = preg_replace_callback($pattern, 함수($ Matcher) { '{Include File ='.Strtolower($ matcher [1]) '}'를 반환합니다. $source) 🎜>원본 주소: http://www.moke8.com/article-10688-1.html

위 내용은 내용을 포함하여 ecshop 수정자 preg_replace/e에 대한 몇 가지 안전하지 않은 변경 사항을 소개합니다. PHP 튜토리얼에 관심이 있는 친구들에게 도움이 되기를 바랍니다.

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.