zoukankan      html  css  js  c++  java
  • 报错compile_str() flow.php on line 375的解决方法

    flow.php line 375,flow.php  找到375行:

             * 保存收货人信息
             */
            $consignee = array(
                'address_id'    => empty($_POST['address_id']) ? 0  :   intval($_POST['address_id']),
                'consignee'     => empty($_POST['consignee'])  ? '' :   compile_str(trim($_POST['consignee'])),
                'country'       => empty($_POST['country'])    ? '' :   intval($_POST['country']),
                'province'      => empty($_POST['province'])   ? '' :   intval($_POST['province']),
                'city'          => empty($_POST['city'])       ? '' :   intval($_POST['city']),
                'district'      => empty($_POST['district'])   ? '' :   intval($_POST['district']),
                'email'         => empty($_POST['email'])      ? '' :   compile_str($_POST['email']),
                'address'       => empty($_POST['address'])    ? '' :   compile_str($_POST['address']),
                'zipcode'       => empty($_POST['zipcode'])    ? '' :   compile_str(make_semiangle(trim($_POST['zipcode']))),
                'tel'           => empty($_POST['tel'])        ? '' :   compile_str(make_semiangle(trim($_POST['tel']))),
                'mobile'        => empty($_POST['mobile'])     ? '' :   compile_str(make_semiangle(trim($_POST['mobile']))),
                'sign_building' => empty($_POST['sign_building']) ? '' :compile_str($_POST['sign_building']),
                'best_time'     => empty($_POST['best_time'])  ? '' :   compile_str($_POST['best_time']),
            );
    

    这里代码多了个函数 compile_str。 改函数是ecshop最新补丁新加入进入的。原本的这块代码是

               'address_id'    => empty($_POST['address_id']) ? 0  : intval($_POST['address_id']),
                'consignee'     => empty($_POST['consignee'])  ? '' : trim($_POST['consignee']),
                'country'       => empty($_POST['country'])    ? '' : $_POST['country'],
                'province'      => empty($_POST['province'])   ? '' : $_POST['province'],
                'city'          => empty($_POST['city'])       ? '' : $_POST['city'],
                'district'      => empty($_POST['district'])   ? '' : $_POST['district'],
                'email'         => empty($_POST['email'])      ? '' : $_POST['email'],
                'address'       => empty($_POST['address'])    ? '' : $_POST['address'],
                'zipcode'       => empty($_POST['zipcode'])    ? '' : make_semiangle(trim($_POST['zipcode'])),
                'tel'           => empty($_POST['tel'])        ? '' : make_semiangle(trim($_POST['tel'])),
                'mobile'        => empty($_POST['mobile'])     ? '' : make_semiangle(trim($_POST['mobile'])),
                'sign_building' => empty($_POST['sign_building']) ? '' : $_POST['sign_building'],
                'best_time'     => empty($_POST['best_time'])  ? '' : $_POST['best_time'],

    该函数是为补漏洞的。 在文件lib_base.php 776行。

    /**
     * 过滤用户输入的基本数据,防止script攻击
     *
     * @access      public
     * @return      string
     */
    function compile_str($str)
    {
        $arr = array('<' => '<', '>' => '>');
        return strtr($str, $arr);
    }
    
    该函数是为补漏洞的。 过滤用户输入的基本数据,防止script攻击!所以如果网站提示缺少此函数,直接补个函数就可以了。贴在flow.php底部,问题就解决了
  • 相关阅读:
    PriorityQueue是个基于优先级堆的极大优先级队列
    【Android游戏开发之四】基础的Android 游戏框架(一个游戏角色在屏幕行走的demo)
    Android示例程序剖析之LunarLander游戏
    java程序员必知的 8大排序
    【Android游戏开发之一】设置全屏以及绘画简单的图形
    嵌套For循环性能优化案例
    Android游戏开发教程之三:View类用法详解
    Ari Zilka谈Ehcache的进程内堆外缓存BigMemory
    如何进行Java EE性能测试与调优
    亲身实践,JAVA最优良的Adapter模式适配器模式
  • 原文地址:https://www.cnblogs.com/chen-lhx/p/4064771.html
Copyright © 2011-2022 走看看