Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
InventoryValuation.php
07-03-2013, 10:30 AM,
#6
RE: InventoryValuation.php
DB_escape_string()

But pretty sure that all $_POST variables get DB_escape_string'ed inside session.inc at the start of the script so injection nonsense is avoided.

Code:
    foreach ($_POST as $PostVariableName => $PostVariableValue) {
        if (gettype($PostVariableValue) != 'array') {
            if(get_magic_quotes_gpc()) {
                $_POST['name'] = stripslashes($_POST['name']);
            }
            $_POST[$PostVariableName] = DB_escape_string($PostVariableValue);
        } else {
            foreach ($PostVariableValue as $PostArrayKey => $PostArrayValue) {
                if(get_magic_quotes_gpc()) {
                    $PostVariableValue[$PostArrayKey] = stripslashes($value[$PostArrayKey]);
                }
                $PostVariableValue[$PostArrayKey] = DB_escape_string($PostArrayValue);
            }
        }
    }

    /* iterate through all elements of the $_GET array and DB_escape_string them
    to limit possibility for SQL injection attacks and cross scripting attacks
    */
    foreach ($_GET as $GetKey => $GetValue) {
        if (gettype($GetValue) != 'array') {
            $_GET[$GetKey] = DB_escape_string($GetValue);
        }
    }

Perhaps this code is munting your category name - what is the character that is causing the trouble? Perhaps we need to trap it for future.
Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Reply


Messages In This Thread
InventoryValuation.php - by iangrech - 07-03-2013, 08:28 AM
RE: InventoryValuation.php - by phil - 07-03-2013, 08:46 AM
RE: InventoryValuation.php - by iangrech - 07-03-2013, 08:50 AM
RE: InventoryValuation.php - by phil - 07-03-2013, 09:00 AM
RE: InventoryValuation.php - by iangrech - 07-03-2013, 09:08 AM
RE: InventoryValuation.php - by phil - 07-03-2013, 10:30 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)