Fix inconsistent handling of empty string in INSERT/UPDATE queries

This commit is contained in:
Kijin Sung 2020-07-02 16:04:05 +09:00
parent 54375d16ad
commit 945c09059a
4 changed files with 43 additions and 6 deletions

View file

@ -603,11 +603,12 @@ class Query extends VariableBase
* Check if a variable is considered valid for XE compatibility.
*
* @param mixed $var
* @param bool $allow_empty_string
* @return bool
*/
public static function isValidVariable($var): bool
public static function isValidVariable($var, $allow_empty_string = true): bool
{
if ($var === null || $var === '')
if ($var === null || ($var === '' && !$allow_empty_string))
{
return false;
}