报错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底部,问题就解决了
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SELECT bs.report_no, bs.sample_id, bs.test_id, bs.service_type, bs.sample_name, bs.total_fee, bs.receivable_fee, bs.sample_no, bs.ranges, bs.grade, bs.sample_remark AS remark, bs.factory, bs.item_name, bs.apply_dept, bs.specification, bs.factory_number, bs.calibrat_point, bs.mandatory_flag, bs.inspection_type, bs.report_org_name, bs.plan_complete_date, bs.standard_instrument_name, bs.bleeding_site_name, bs.arrive_date, DATEDIFF( bs.plan_complete_date, NOW()) AS surplus_days, bs.order_no, bs.order_type, bs.customer_name, bs.order_id, bs.business_type, bs.group_id, bs.group_name, bs.item_id, bs.is_merge, bs.pass_time, bs.audit_time, bs.report_id, bs.compile_time, bs.generate_time, bs.pass_user_name, bs.audit_user_name, bs.compile_user_name, bs.report_state, bs.is_just_certificate, bs.label_price, bs.labor_cost, bs.product_type, bs.batch_number, bs.original_number, bs.type_no, bs.template_id, bs.template_version, bs.standard_instrument_id, bs.standard_instrument_name, bs.report_query_code, bs.test_user_id, bs.test_user_name, bs.test_time, bs.review_user_id, bs.review_user_name, bs.review_time, bs.or_number, bs.test_result, bs.test_result_text, bs.test_date, bs.test_address, bs.result_value, bs.unit, bs.test_dept_id, bs.test_dept_name, bs.sample_mass, bs.form, bs.color, bs.clarity, bs.amplification_detection, bs.precious_metal, bs.remarks, bs.photo, bs.identifying_code, bs.diamond_quality, bs.hand_ring, bs.craft, bs.instrument_photo, bs.customer_item_basis, bs.quality_photo, bs.check_point, bs.check_code, bs.mass_unit, bs.manufacturer_name, bs.manufacturer_addr, bs.result_sample_describe AS sampleDescribe, bs.test_rule AS metalRuleIdsStr, bsa.attach_id FROM view_sample_info bs JOIN bus_sample_report bsr ON bs.report_id = bsr.id JOIN bus_sample sa ON bsr.sample_id = sa.id JOIN bus_sample_attr bsa ON sa.id = bsa.id 需要按照bs.report_no 的整数来从小到大进行排序
最新发布
07-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值