M3 Security Fixes for Pass 35
This commit is contained in:
@@ -231,7 +231,7 @@ class Helper
|
||||
{
|
||||
ini_set('max_execution_time', Config::get('arrays.PHPTimeOut'));
|
||||
|
||||
$insertSQL = DB::connection(config('m3.connection', 'pgsql'))->table('ICM699M')->insert($data);
|
||||
DB::connection(config('m3.connection', 'pgsql'))->table('ICM699M')->insert($data);
|
||||
// dump($insertSQL);
|
||||
}
|
||||
|
||||
@@ -251,10 +251,10 @@ class Helper
|
||||
return $substring;
|
||||
}
|
||||
|
||||
public static function checkLength($JSONL, $DBL, $TYPE)
|
||||
public static function checkLength($jsonFields, $dbFields, $type)
|
||||
{
|
||||
// Check type
|
||||
$jSONType = gettype($JSONL);
|
||||
$jSONType = gettype($jsonFields);
|
||||
|
||||
switch ($jSONType) {
|
||||
case 'string':
|
||||
@@ -271,24 +271,24 @@ class Helper
|
||||
break;
|
||||
}
|
||||
|
||||
$TYPE = $TYPE == 'integer' || $TYPE == 'DEC' ? 'number' : $TYPE;
|
||||
$type = $type == 'integer' || $type == 'DEC' ? 'number' : $type;
|
||||
|
||||
// Check Json Field should be < DB Field
|
||||
$lengthOK[413] = (strlen($JSONL) <= $DBL) ? true : false;
|
||||
$lengthOK[413] = (strlen($jsonFields) <= $dbFields) ? true : false;
|
||||
// Empty Fields
|
||||
$lengthOK[411] = true; // !empty($JSONL) ? true : false ;
|
||||
$lengthOK[411] = true; // !empty($jsonFields) ? true : false ;
|
||||
// Wrong Types
|
||||
$lengthOK[417] = true; // $jSONTypeConv == $TYPE ? true : false ;
|
||||
$lengthOK[417] = true; // $jSONTypeConv == $type ? true : false ;
|
||||
// Log::info($lengthOK);
|
||||
|
||||
return $lengthOK;
|
||||
}
|
||||
|
||||
public static function sanityzeString($StrTosanityze)
|
||||
public static function sanityzeString($strToSanitize)
|
||||
{
|
||||
$badChars = Config::get('arrays.BadChars');
|
||||
|
||||
$goodString = trim($StrTosanityze);
|
||||
$goodString = trim($strToSanitize);
|
||||
$goodString = str_replace("'", '', $goodString);
|
||||
$goodString = str_replace("\u{f0e0}", '', $goodString);
|
||||
$goodString = preg_replace('/\\\\u201[0-9A-F]+/i', '', $goodString);
|
||||
|
||||
Reference in New Issue
Block a user