tpshop2.0无登录状态下提交他人未提交订单bug

浏览:956 发布日期:2017/07/09 分类:技术分享 关键字: bug tpsop tpshop_bug
tpshop无登录状态下提交他人未提交订单

tpshop是一款基于thinkphp的开源商城,因为二次开发站长本人发现了bug,分享给大家,虽然说接入付款后不一定能提交,但程序不严谨,暴露订单是必然


图1
点击201707071140118178单号的“立即付款”按钮,跳至下图(不要立即点击“立即付款”)
tpshop页面

图2
另外一个页面打开用户退出页面,正常退出:(http://jfshop.qq/index.php/Mobile/User/userinfo.html),点击“安全退出”
tpshop页面

图3
点击图2中的“立即付款”,页面跳至如下
tpshop页面

图4
回到我的订单页面,
http://jfshop.qq/index.php/Mobile/User/order_list/type/WAITPAY.html
待付款页面少了201707071140118178订单编号的订单,待发货页面多了201707071140118178订单编号的订单
tpshop页面

图5

解决方案:
文件位置:application/mobile/controller/Cart.php
添加如下代码:    public function cart4() {
 
        $order_id = I('order_id/d');
        $order_where = array(
            "order_id" => $order_id,
            "user_id" => $this->user_id,
        );
        $order = M('Order')->where($order_where)->find();
        if (empty($order)) {
            $this->error('该订单不存在');
        }
文章来源:http://www.yunshare.net/Article/4/60.html
最佳答案
评论( 相关
后面还有条评论,点击查看>>