A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/4646 below:

[apex] ApexSOQLInjection does not recognise SObjectType or SObjectField as safe variable types · Issue #4646 · pmd/pmd · GitHub

This contrived code example demonstrates the issue.

    public static Set<String> getDistinctValues(SObjectType type, SObjectField field, Set<Id> ids) {
        List<SObject> records = Database.query('SELECT ' + field + ' FROM ' + type + ' WHERE Id In :ids');
        Set<String> values = new Set<String>();
        for(SObject record : records) {
            values.add((String) record.get(field));
        }
        return values;
    }

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4