function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lokesh KumarLokesh Kumar 

App Logic Vulnerability Prevention Prevent Open Redirects in Your Code

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()){

                insert rtype;

                String completion = ApexPages.currentPage().getParameters().get('finishURL');
        savePage = new PageReference('/'+completion);
        return savePage;

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

User-added image 
Randy SchultzRandy Schultz

amit, you should not be giving such bad advice..

You code is close. You should assign the returned string from the call of replaceFirst method since it does not modify the original;
Sales Force doc does not clearly indicate that... The example does. 

completion = completion.replaceFirst('/','');

Felix Markman 16Felix Markman 16
I have the exact same problem. Stumped. I posted my question here: