Home > Backend Development > PHP Tutorial > Several unsafe changes to the ecshop modifier preg_replace/e

Several unsafe changes to the ecshop modifier preg_replace/e

WBOY
Release: 2016-08-08 09:20:30
Original
809 people have browsed it
Mainly concentrated in the upload/includes/cls_template.php file: 1: line 300: Original statement: return preg_replace("/{([^}{n]*)}/e" , "$this->select('\1');", $source); Modified to: return preg_replace_callback("/{([^}{n]*)}/", function ($r) { return $this->select($r[1]); }, $source); 2: line 495: Original sentence: $out = " Modified to: $replacement = preg_replace_callback("/('\$[^,]+)/" ,                                      function($matcher ){          ,                            var_export($t, true));                                                      3: line 554: //zuimoban.com Reprint without URL, wooden JJ Original sentence: $val = preg_replace("/[([^[]]*)]/eis", "'.'.str_replace('$',' $','\1')", $val);                                                     ‐         ‑ out right out of's'ce's' Out’‐‐‐‐‐‐‐‐‐ out‐ out off out.              $matcher) {                                                                                                                                                                                                                , $val); 4: line 1071: Original statement: $replacement = "'{inc file='.strtolower('\1'). '}'" ; $source = preg_replace($pattern, $replacement, $source); Modified to: $source = preg_replace_callback($pattern, function ($matcher) { ​​$source);Original address: http://www.moke8.com /article-10688-1.html The above introduces several unsafe changes to the ecshop modifier preg_replace/e, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template