diff --git a/lib/private/db/querybuilder/quotehelper.php b/lib/private/db/querybuilder/quotehelper.php index 0735f313ab..4b62fee6a6 100644 --- a/lib/private/db/querybuilder/quotehelper.php +++ b/lib/private/db/querybuilder/quotehelper.php @@ -52,7 +52,7 @@ class QuoteHelper { return (string) $string; } - if ($string === null || $string === '*') { + if ($string === null || $string === 'null' || $string === '*') { return $string; } diff --git a/tests/lib/db/querybuilder/quotehelpertest.php b/tests/lib/db/querybuilder/quotehelpertest.php index 904b4c500d..b83d9eed2d 100644 --- a/tests/lib/db/querybuilder/quotehelpertest.php +++ b/tests/lib/db/querybuilder/quotehelpertest.php @@ -43,6 +43,10 @@ class QuoteHelperTest extends \Test\TestCase { [new Literal('literal'), 'literal'], [new Literal(1), '1'], [new Parameter(':param'), ':param'], + + // (string) 'null' is Doctrines way to set columns to null + // See https://github.com/owncloud/core/issues/19314 + ['null', 'null'], ]; }