Skip to content

Commit 0cfd5c0

Browse files
committed
8782 - Union queries allow all data
1 parent 3b62597 commit 0cfd5c0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

core/dbunionsearch.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct($aSearches)
5959
public function AllowAllData($bAllowAllData = true)
6060
{
6161
foreach ($this->aSearches as $oSearch) {
62-
$oSearch->AllowAllData();
62+
$oSearch->AllowAllData($bAllowAllData);
6363
}
6464
}
6565

tests/php-unit-tests/unitary-tests/core/DBSearchTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,15 @@ public function testAllowAllData()
694694
$this->CheckNestedSearch($sNestedQuery, false);
695695
}
696696

697+
public function testAllowAllDataOnUnions()
698+
{
699+
$oSearch = \DBObjectSearch::FromOQL('SELECT Server UNION SELECT VirtualMachine');
700+
$oSearch->AllowAllData(false);
701+
self::assertFalse($oSearch->IsAllDataAllowed(), 'DBUnionSearch AllowData value');
702+
$oSearch->AllowAllData(true);
703+
self::assertTrue($oSearch->IsAllDataAllowed(), 'DBUnionSearch AllowData value');
704+
}
705+
697706
private function CheckNestedSearch($sQuery, $bAllowAllData)
698707
{
699708
$oNestedQuerySearch = \DBObjectSearch::FromOQL($sQuery);

0 commit comments

Comments
 (0)