url helper extension [safe_url] |
[eluser]Hannes Nevalainen[/eluser]
I developed som tiny helper functions for the url helper. If you have links on your site like this http://mydomain.com/blog/delete/23 it's easy for the an user to change that id to something else and delete something that should not be deleted. With safe url a hash is added as the last segment in the url http://mydomain.com/blog/delete/23/6ca40...f215a7d7b1. If a user changes the uri in someway the hash would not be the same and the function validate_safe_url() would return false; Extension to the url helper Code: #Returns the safe url for the provided URI Code: class Blog extends Controller{ Notify, you should set your encryption_key in config.php for this to be "safe"/safer. |
Welcome Guest, Not a member yet? Register Sign In |