I have a very simple public force.com site (lets use the subdirectory mypublicsite
), that accepts a single parameter.
Since the site is public, users may send malicous content through this parameter. I already found out, that %
is one of these illegal strings. If I try to access the page in preview mode (as an interal user) like this
https://my-custom-company-domain.visualforce.com/apex/mypublicsite?Id=%
I receive the following error:
If I try to access the page as the actual public page ...
https://my-custom-company-domain.force.com/mypublicsite?Id=%
I see the following ugly maintenance notice:
So the question is: How to validate URL parameters in a way, that invalid input will not break the whole visualforce page?