浏览代码

修复一个sql 注入安全漏洞

star7th 9 年之前
父节点
当前提交
8e0989c491
共有 3 个文件被更改,包括 3 次插入4 次删除
  1. 1 2
      Application/Home/Controller/ItemController.class.php
  2. 1 1
      Application/Home/View/Item/add.html
  3. 1 1
      composer.json

+ 1 - 2
Application/Home/Controller/ItemController.class.php

@@ -134,8 +134,7 @@ class ItemController extends BaseController {
         $current_page_id = I("page_id/d");
         //判断个性域名
         if ($item_domain) {
-            $item_domain = \SQLite3::escapeString($item_domain) ;
-            $item = D("Item")->where("item_domain = '$item_domain' ")->find();
+            $item = D("Item")->where("item_domain = '%s'",array($item_domain))->find();
             if ($item['item_id']) {
                 $item_id = $item['item_id'] ;
             }

+ 1 - 1
Application/Home/View/Item/add.html

@@ -31,7 +31,7 @@
 
         <input type="text" class="input-block-level" id="item_name" name="item_name" placeholder="{$Think.Lang.item_name}" autocomplete="off" value="{$item.item_name}" >
         <input type="text" class="input-block-level" id="item_description" name="item_description" placeholder="{$Think.Lang.item_description}" autocomplete="off" value="{$item.item_description}">
-        <input type="text" class="input-block-level"  name="item_domain" placeholder="{$Think.Lang.item_domain}" autocomplete="off" value="{$item.item_domain}" >
+        <input type="text" style="display:none" class="input-block-level"  name="item_domain" placeholder="{$Think.Lang.item_domain}" autocomplete="off" value="{$item.item_domain}" >
         <input style="display:none"><!-- for disable autocomplete on chrome -->
         <input style="display:none"><!-- for disable autocomplete on chrome -->
         <input type="text" onfocus="this.type='password'" id="password" class="input-block-level" name="password" placeholder="{$Think.Lang.visit_password_placeholder}" title="{$Think.Lang.visit_password_placeholder}" autocomplete="off" value="{$item.password}">

+ 1 - 1
composer.json

@@ -5,7 +5,7 @@
     "description": "ShowDoc is a tool greatly applicable for an IT team to share documents online",
     "keywords": ["showdoc","documents","Api"],
     "homepage": "https://github.com/star7th/showdoc",
-    "version":"v1.2.5",
+    "version":"v1.2.6",
     "license": "Apache-2.0",
     "authors": [
         {