チェンジセット 87

差分発生行の前後
無視リスト:
コミット日時:
2009/01/11 02:04:50 (15 年前)
コミッタ:
sorshi
ログメッセージ:

foltialib.php:
escape_string()とhtmlspecialchars()をまともに使えてなかった箇所を修正。
SQLインジェクションの可能性があった箇所を修正。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • trunk/doc/CHANGES.txt

    r86 r87  
    11foltia 更新履歴 http://www.dcc-jpl.com/soft/foltia/ 
    22 
     309.1.11 
     4foltialib.php: 
     5escape_string()とhtmlspecialchars()をまともに使えてなかった箇所を修正。 
     6SQLインジェクションの可能性があった箇所を修正。 
    37 
    4809.1.10 
  • trunk/install/php/foltialib.php

    r84 r87  
    1919    if ($_GET["{$key}"] != "") { 
    2020                $value = $_GET["{$key}"]; 
    21                   escape_string($value); 
    22                   htmlspecialchars($value); 
     21        $value = escape_string($value); 
     22        $value = htmlspecialchars($value); 
    2323        return ($value); 
    2424    } 
     
    2828    if ($_GET["{$key}"] != "") { 
    2929                $value = $_GET["{$key}"]; 
    30                 escape_string($value); 
    31                 htmlspecialchars($value); 
    3230                $value = ereg_replace("[^-0-9]", "", $value); 
    3331                $value = escape_numeric($value); 
     
    3836        //フォームデコード 
    3937          function getform($key) { 
    40                         //    global $where; 
    4138    if ($_POST["{$key}"] != "") { 
    4239                $value = $_POST["{$key}"]; 
    43                   escape_string($value); 
    44                   htmlspecialchars($value); 
     40        $value = escape_string($value); 
     41        $value = htmlspecialchars($value); 
    4542        return ($value); 
    4643    } 
     
    5047    if ($_POST["{$key}"] != "") { 
    5148                $value = $_POST["{$key}"]; 
    52                   escape_string($value); 
    53                   htmlspecialchars($value); 
    54                    $value = ereg_replace("[^0-9]", "", $value); 
     49               $value = escape_string($value); 
     50        $value = htmlspecialchars($value); 
     51        $value = ereg_replace("[^0-9]", "", $value); 
    5552                $value = escape_numeric($value); 
    5653        return ($value); 
     
    106103         
    107104        /* SQL 文字列のエスケープ */ 
    108         function escape_string($sql, $quote = TRUE) { 
     105        function escape_string($sql, $quote = FALSE) { 
    109106                if ($quote && strlen($sql) == 0) { 
    110107                        return "null"; 
track feed