mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-25 18:59:12 +02:00
DB_RemoveBadChars function supports arrays now, this caused invisible notice errors.
This commit is contained in:
parent
866c3ab7f4
commit
a77add0976
@ -257,17 +257,41 @@ function DB_RemoveParserSpecialBadChars($myString)
|
|||||||
return $returnstr;
|
return $returnstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function DB_RemoveBadChars($myString, $dbEngine = DB_MYSQL, $bForceStripSlahes = false)
|
function DB_RemoveBadChars($myValue, $dbEngine = DB_MYSQL, $bForceStripSlahes = false)
|
||||||
{
|
{
|
||||||
if ( $dbEngine == DB_MSSQL )
|
// Check if Array
|
||||||
{
|
if ( is_array($myValue) )
|
||||||
// MSSQL needs special treatment -.-
|
{ // Array value
|
||||||
return str_replace("'","''",$myString);
|
$retArray = array();
|
||||||
|
foreach( $myValue as $mykey => $myString )
|
||||||
|
{
|
||||||
|
if ( $dbEngine == DB_MSSQL )
|
||||||
|
{
|
||||||
|
// MSSQL needs special treatment -.-
|
||||||
|
$retArray[$mykey] = str_replace("'","''",$myString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Replace with internal PHP Functions!
|
||||||
|
$retArray[$mykey] = addslashes($myString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return fixed array!
|
||||||
|
return $retArray;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{ // Single value
|
||||||
// Replace with internal PHP Functions!
|
if ( $dbEngine == DB_MSSQL )
|
||||||
return addslashes($myString);
|
{
|
||||||
|
// MSSQL needs special treatment -.-
|
||||||
|
return str_replace("'","''",$myValue);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Replace with internal PHP Functions!
|
||||||
|
return addslashes($myValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user