I want to avoid .. for image files. In my validations, the regex reads:
%r{\.(gif|png|jpg)$}i
for image URLs. The problem is that fred..png will also pass instead of recognising the double ..
Thanks for helping.
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.
To prevent the case you described, which would only be for a double dot right before the extension:
Edit: If you want to have it such that
..is nowhere in the string, it would be easiest to do that in code (pseudo:if regex.matches(filename) and '..' not in filename).