ecshop服务端+后台错误修改

来源:互联网 发布:软件开发赚钱吗 编辑:程序博客网 时间:2024/06/11 12:24

1.Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in E:\work\server\ECShop_V2.7.3_UTF8_release1106\upload\includes\cls_template.php on line 300

        解决:

               return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);

               改为: return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);

 

2.Strict Standards: Only variables should be passed by reference in includes\cls_template.php on line 422

                 解决 

                      $tag_sel = array_shift(explode(' ', $tag)); 

                      改为:$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);

 

 

3.Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in \includes\cls_template.php on line 499

                 解决:

                     $out = "<?php \n" . '$k = ' . //$out = "<?php \n" . '$k = ' . preg_replace("/(\'\\$[^,]+)/e" , "stripslashes(trim('\\1','\''));", var_export($t, true)) . ";\n";

                     改为:  $out = "<?php \n" . '$k = ' . preg_replace_callback("/(\'\\$[^,]+)/", function($r) { return stripslashes(trim($r[1],'\'')); }, var_export($t, true)) . ";\n";

 

4.Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in includes\cls_template.php on line 552

                 解决:

                            $val = preg_replace("/\[([^\[\]]*)\]/eis", "'.'.str_replace('$','\$','\\1')", $val);

                            改为:$val = preg_replace_callback("/\[([^\[\]]*)\]/is", function($r) { return '.'.str_replace('$','\$',$r[1]); }, $val);

 

5.Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in includes\cls_template.php on line 1071

                 解决:

                       $pattern='/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/se';

                       $replacement = "'{include file='.strtolower('\\1'). '}'";

                       $source = preg_replace($pattern, $replacement, $source);

                       改为:

                      $pattern='/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/s';

                      $source = preg_replace_callback($pattern, function($ro){return '{include file='.strtolower($ro[1]). '}';}, $source);

 
6.Strict Standards: Only variables should be passed by reference in includes\lib_main.php on line 1329

            解决:

                 $ext = end(explode('.', $tmp));

                 改为:$ext_arr = explode('.', $tmp);$ext = end($ext_arr);

 


7.Strict Standards: Non-static method cls_image::gd_version() should not be called statically in includes\lib_base.php on line 346

             解决:

                     return cls_image::gd_version();

                    改为:$cls_image = new cls_image(); return $cls_image->gd_version();

 

 

8.Strict Standards: Redefining already defined constructor for class captcha in includes\cls_captcha.php on line 119(网站后台验证码不显示时出现)

                解决:

                        找到下面这段代码

                       function __construct($folder = '', $width = 145, $height = 20)

                      {

                               $this->captcha($folder, $width, $height);

                      }

                    将它移到function captcha($folder = '', $width = 145, $height = 20) 的上边。

 

 

 9.Strict Standards: mktime(): You should be using the time() function instead in admin\sms_url.php on line 31

        Strict Standards: mktime(): You should be using the time() function instead inadmin\shop_config.php on line32(php版本问题

                 解决:          mktime()    修改为    time()

 


 

 

 

 

0 0