how can i control on submitted Urls if the link is to an image file? and also how can i sanitize any kind of hack attack by that url?
i’m using Codeigniter maybe some good library to control submitted urls ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Why not let apache (or nginx, etc.) serve your static files for you?
If you serve them through php–CodeIgniter or not–you open yourself up to a much greater opportunity for hacks.
Additionally, you’ll probably run a minimum of 3MB of memory per request through CI, whereas a static file server will usually run at the file’s size or less.
I could keep going. In fact, I will. CI has issues with seemingly random session expiration when serving resources (i.e. images, AJAX, etc.)
Are you still reading this? Serve your static files through apache.
UPDATE:
I assumed by your “submitted URL” language that it was the URI in question. Now it seems to be a question about validating user submitted input data. If it’s a URL, I assume it’s an image on a remote server. For this case, you’ll need to use cURL (or another http wrapper) to download headers for that URL. If the Content-Type header is present, you can use that to determine whether the file is an image.