From 3bebb9bf0ffd943fb2d5a02fab051633758961fc Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Fri, 4 May 2018 15:08:48 +0000 Subject: [PATCH] convert inline comment to PHPDoc SVN:trunk[5772] --- core/cmdbsource.class.inc.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/core/cmdbsource.class.inc.php b/core/cmdbsource.class.inc.php index bb4d796af..86f62c07d 100644 --- a/core/cmdbsource.class.inc.php +++ b/core/cmdbsource.class.inc.php @@ -492,15 +492,19 @@ class CMDBSource public static function DBPwd() {return self::$m_sDBPwd;} public static function DBName() {return self::$m_sDBName;} + /** + * Quote variable and protect against SQL injection attacks + * Code found in the PHP documentation: quote_smart($value) + * + * @param mixed $value + * @param bool $bAlways should be set to true when the purpose is to create a IN clause, + * otherwise and if there is a mix of strings and numbers, the clause would always be false + * @param string $cQuoteStyle + * + * @return array|string + */ public static function Quote($value, $bAlways = false, $cQuoteStyle = "'") { - // Quote variable and protect against SQL injection attacks - // Code found in the PHP documentation: quote_smart($value) - - // bAlways should be set to true when the purpose is to create a IN clause, - // otherwise and if there is a mix of strings and numbers, the clause - // would always be false - if (is_null($value)) { return 'NULL';