• Mohindar Saini 14
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
public void resetPagination(String country,String state, String fieldAPIName, Boolean uniqueMap, Boolean removeDiacritics ){
            queryData(country,state,fieldAPIName,uniqueMap,removeDiacritics);
            size = PAGINATION_SIZE;
            con.setPageSize(PAGINATION_SIZE);
            noOfRecords = con.getResultSize();
            if(noOfRecords >= PAGINATION_SIZE) {
                showPagination = true;
            }
            else{
                showPagination = false;
            }
        }
        
        public void resetPaginationForAccount(String query, Integer size) {
            List<SObject> dataList = Database.query(query);
            con = new ApexPages.StandardSetController(dataList);
            this.size = size;
            con.setPageSize(this.size);
            noOfRecords = con.getResultSize();
            showPagination = noOfRecords >= this.size;
        }
        public void next(){
            con.next();
        }
        
        public void previous(){
            con.previous();        
        }

        public void first(){
            con.first();
        }
        
        public void last(){
            con.last();        
        }
    }
 
Isssue is, how to fix Insecure direct object references (IDORs) in SOQL list query i have marked in bold  list<Account> accountList
 
public PageReference ReturnLogin() {     
        Date dateDOB = null;
        String dateDOBString = null;
        if(String.isNotBlank(dob)) {
            dob = B_Common_Util.dateFormatConversion(dob);
            dob = String.escapeSingleQuotes(dob);
            String[] splitedDate_MDY = dob.split('/');// date is in DD/MM/YYYY format
            if(splitedDate_MDY.size() == 3){
                dateDOB = Date.newInstance(Integer.valueOf(splitedDate_MDY[2]), Integer.valueOf(splitedDate_MDY[1]),Integer.valueOf(splitedDate_MDY[0]));
                dateDOBString = splitedDate_MDY[2] + '-' + splitedDate_MDY[1] + '-' + splitedDate_MDY[0];
            }
        }
        isInactiveSite = false;
        if (SAN != null) {
            SAN = communitySANPrefix + SAN;
            list<Account> accountList = [Select id,Location_Status__c, Parent.CPF__c, Parent.CNPJ__c from Account where SAN__c =: SAN and RecordType.Name =: Brazil_Constants.ACCOUNT_RECORD_TYPE_LOCATION and ParentId != null];
            if (accountList != null && accountList.size() > 0) {
                Account locAcc = accountList[0];
                if(locAcc.Location_Status__c == NULL || locAcc.Location_Status__c == 'Pending' || locAcc.Location_Status__c == 'Canceled'){
                   
In line no. 6 how to slove the Server-side payload injection clayton issue?
HttpRequest req = new HttpRequest();
      String Endpoint;
      if (endpointParams == null || endpointParams.NamedCred__c) {
        Endpoint = 'callout:';
        System.debug('Endpoint is1111' + Endpoint);
        req.setEndpoint(Endpoint);
      }
In line no. 6 how to slove the Server-side payload injection clayton issue?
HttpRequest req = new HttpRequest();
      String Endpoint;
      if (endpointParams == null || endpointParams.NamedCred__c) {
        Endpoint = 'callout:';
        System.debug('Endpoint is1111' + Endpoint);
        req.setEndpoint(Endpoint);
      }