2012-01-16 21 views
0

私のお父さんのエンタープライズシステム内の問題を解決しようとしていますが、システムにはInternet Explorerだけで動作するボタンがあり、他のブラウザでは機能しません。このシステムでは、iPadや他の運用システムを使って作業しています... Linxという企業からこのシステムを購入しましたが、このシステムのコードはクライアント側(JavaScript)のクエリを処理するには危険です。

これがInternet Explorerでうまく動作する理由が分かっていれば、私はとても素晴らしいことになるでしょう!
アドバイスありがとうございました...

観測:ボタンのhtmlとボタンのjavascript機能をコピーして貼り付けました。ボタンはInternet Explorerで動作します

<script> 
    function Query_onclick() { 
     xwhere = ""; 
     xflag = 1; 

     if (xmodelos != ""){ 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 
      xwhere = xwhere + " Modelagem = '" + xmodelos + "'"; 
     } 

     if (xmateriais != "") { 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 
      xwhere = xwhere + " Material = '" + xmateriais + "'"; 
     } 

     if (xgrupos != ""){ 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 

      xwhere = xwhere + " Grupo_produto = '" + xgrupos + "'"; 

     } 

     if (xsubgrupos != "") { 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 

      xwhere = xwhere + " Subgrupo_produto = '" + xsubgrupos + "'"; 

     } 

     if (xcategorias != ""){ 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 

      xwhere = xwhere + " p.cod_categoria in (select cod_categoria from produtos_categoria where CATEGORIA_PRODUTO ='" + xcategorias + "')"; 

     } 

     if (xsubcategorias != ""){ 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 

      xwhere = xwhere + " p.cod_subcategoria in (select cod_subcategoria from produtos_subcategoria where SUBCATEGORIA_PRODUTO ='" + xsubcategorias + "')"; 

     } 

     if (xfabricante != ""){ 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 

      xwhere = xwhere + " Fabricante = '" + xfabricante + "'"; 

     } 

     if (xlinhas != "") { 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 
      xwhere = xwhere + " Linha = '" + xlinhas + "'";    
     } 

     if (xcomposicao != "") { 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 
      xwhere = xwhere + " composicao = '" + xcomposicao + "'";     
     } 

     if (xcolecoes != "") { 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 
      xwhere = xwhere + " Colecao = '" + xcolecoes + "'"; 
     } 

     if (xgriffes != ""){ 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 
      xwhere = xwhere + " Griffe = '" + xgriffes + "'"; 
     } 

     if (xtipos != ""){ 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 

      xwhere = xwhere + " Tipo_produto = '" + xtipos + "'"; 

     } 


     if (produto.value != "") { 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 

      xwhere = xwhere + " produto like '" + Urlencode("%" + produto.value + "%") + "'"; 

     } 

     if (descricao.value != "") { 
      if (xwhere != "") { 
       xwhere = xwhere + " and "; 
      } 

      xwhere = xwhere + " desc_produto like '" + urlencode(descricao.value) + "'"; 

     } 

     if (xwhere != ""){ 
      if (Foto.checked == 1) { 
       xfoto = "&xfoto=" + Foto.checked;   
      } 
      else { 
       xfoto = "&xfoto=false"; 
      } 
      parent.frames.Principal.location = "../pages/cat_prods.asp?xwhere=" + xwhere + xfoto; 
     } 
     else{ 
      if (Foto.checked == 1) { 
       xfoto = "?xfoto=" + Foto.checked;   
      } 
      else { 
       xfoto = "?xfoto=false"; 
      } 

      parent.frames.Principal.location = "../pages/cat_prods.asp"+ xfoto; 
     } 
    } 
</script> 

<input type="Image" src="image.png" name="Query" value="  Pesquisar " onclick="Query_onclick()"> 
+5

私はあなたに答えがありませんが、私はちょうどコメントしなければなりませんでした:それはおそらく私が今まで見た中で最悪の種類のセキュリティホールです! *** TheDailyWTF.com ***エントリーに合っています!これは初心者のプログラマにSQLインジェクションを教えるとき** **最悪のシナリオ**として使用されるべきです... –

+1

あなたの質問はそれ自身と矛盾しているようです。まず、ボタンがIE上でのみ動作し、IE上では動作しない理由を尋ねます。それがどれであるかを明らかにすることはできますか?そこから始めて、ステータスバーに画面の右下に向かってJSエラーがあるかどうかを確認してください。 Chromeでこれをテストすると、CTRL + SHIFT + Iを押してコンソールにエラーがないかどうかを確認できます。 –

+1

私は知らない[​​それはすべて文脈に依存する](http://thedailywtf.com/Articles/Oklahoma-Leaks-Tens-of-Thousands-of-Social-Security-Numbers,-Other-Sensitive-Data .aspx)。それは悪化する可能性があります... –

答えて

1

あなたはparent.frames.Principal.location.hrefparent.frames.Principal.locationから変更してみてください可能性があります。

+0

それでもクロームでは機能しません。エラーメッセージに「.. is not defined」と表示されます。 –

関連する問題