[pmg-devel] [PATCH pmg-api v2 1/3] ruledb: content-type: drop unreachable fallback for only_content

Stoiko Ivanov s.ivanov at proxmox.com
Tue Feb 25 12:15:02 CET 2025


the default of 'only_content' gets set when fetching the entries from the
database in load_attr - and it defaults to false.

the `// 1` is thus never needed and confusing.

Noticed while debugging another issue, and considered if this false
setting might be the cause.

Fixes:
af418f4 ("ruledb: content-type: add flag for matching only based on magic/content")

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/PMG/RuleDB/ContentTypeFilter.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PMG/RuleDB/ContentTypeFilter.pm b/src/PMG/RuleDB/ContentTypeFilter.pm
index 6818de1..ef1d377 100644
--- a/src/PMG/RuleDB/ContentTypeFilter.pm
+++ b/src/PMG/RuleDB/ContentTypeFilter.pm
@@ -120,7 +120,7 @@ sub parse_entity {
 
 	my $glob_ct = $entity->{PMX_glob_ct};
 
-	my $check_only_content = ${self}->{only_content} // 1;
+	my $check_only_content = ${self}->{only_content};
 
 	if ($magic_ct && $magic_ct =~ m|$self->{field_value}|) {
 	    push @$res, $id;
-- 
2.39.5





More information about the pmg-devel mailing list