Skip to content

Commit

Permalink
Merge pull request ezsystems#1187 from guillaumelecerf/EZP-24565
Browse files Browse the repository at this point in the history
 Fix EZP-24565: correctly quote attributes of custom AttributeFilters
  • Loading branch information
yannickroger committed Sep 4, 2015
2 parents fbe65da + d8423e3 commit 1f02082
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions kernel/classes/ezcontentobjecttreenode.php
Expand Up @@ -1178,6 +1178,7 @@ static function createAttributeFilterSQLStrings( &$attributeFilter, &$sortingInf
if ( $filterDataType == 'string' )
{
$sortKey = 'sort_key_string';
$filterFieldType = 'string';
}
else
{
Expand Down
13 changes: 13 additions & 0 deletions tests/tests/kernel/classes/ezcontentobjecttreenode_test2.php
Expand Up @@ -30,6 +30,19 @@ public function providerForTestIssue23528()
array( 'class_identifier', " ( ezcontentclass.identifier IN ('1','3','foo','1foo','foo_1') ) AND " ),
array( 'class_name', " ( ezcontentclass_name.name IN ('1','3','foo','1foo','foo_1') ) AND " ),
array( 'name', " ( ezcontentobject_name.name IN ('1','3','foo','1foo','foo_1') ) AND " ),
// custom
array( 1, "
a0.contentobject_id = ezcontentobject.id AND
a0.contentclassattribute_id = 1 AND
a0.version = ezcontentobject_name.content_version AND
( a0.language_id & ezcontentobject.language_mask > 0 AND
( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & a0.language_id ) ) & 1 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & a0.language_id ) ) & 2 ) )
<
( a0.language_id & 1 )
+ ( ( a0.language_id & 2 ) )
)
AND ( a0.sort_key_string IN ('1','3','foo','1foo','foo_1') ) AND " ),
);
}

Expand Down

0 comments on commit 1f02082

Please sign in to comment.