• Randy Schultz
  • NEWBIE
  • -1 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
The build.xml seems to completely ingore that a properties file esists. What is missing. The build and properties files are siblings. The setting of the param is  sf.username = justme@curious-otter-myorg.com
no qoutes, space after the equals sign, (terribly fommated file it should be a standard). It would be nice to know the requirements of where these two file need to be stored in relation to the package.xml adn the call to the ant tool.
The build.xml seems to completely ingore that a properties file esists. What is missing. The build and properties files are siblings. The setting of the param is  sf.username = justme@curious-otter-myorg.com
no qoutes, space after the equals sign, (terribly fommated file it should be a standard). It would be nice to know the requirements of where these two file need to be stored in relation to the package.xml adn the call to the ant tool.
Hi All,

Unable to pass App Logic Vulnerability Prevention -- Prevent Open Redirects in Your Code module:

please see the below code:
 
public PageReference save(){
        PageReference savePage;
        if (Schema.SObjectType.Resource_Type__c.isCreateable()){
            try{
                insert rtype;
                String completion = ApexPages.currentPage().getParameters().get('finishURL');
                if(completion.startsWith('/')){
                      completion.replaceFirst('/','');
                      savePage = new PageReference('/'+completion);
                }
                else
                {
                   savePage = new PageReference(completion); 
                }
                savePage.setRedirect(true);
                return savePage;
            }catch (exception e){
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'Unable to update requisitions.  Exception: ' + e.getMessage()));
                return null;
            } 
        }else{
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'You do not have permission to update requisitions'));
            return null;
        }
    }

Thanks in advance
Not able to pass this Challenge PFB screen shot.
My Save Method code.

 
public PageReference save(){
        PageReference savePage;
        if (Schema.SObjectType.Resource_Type__c.isCreateable()){
            try{

                insert rtype;

                String completion = ApexPages.currentPage().getParameters().get('finishURL');
                system.debug('First$'+completion);
        if(completion.startsWith('/')){
        system.debug('Second$'+completion);
            completion.replaceFirst('/','');
system.debug('Third$'+completion);
        }
        savePage = new PageReference('/'+completion);
        
        savePage.setRedirect(true);
        return savePage;
            

            }catch (exception e){
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'Unable to update requisitions.  Exception: ' + e.getMessage()));
                return null;
            } 
        }else{
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'You do not have permission to update requisitions'));
            return null;
        }
    }


User-added image