The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I'm working on some custom image code, not unlike the [img] tag.
What is the best way to ensure that: a) the url starts with http:// (not https://) b) the filetype is .jpg, .gif or .png c) the url contains no spaces, <, >, ?, $, &, [, ], html, or other symbols that could be harmful d) the url only contains letters, numbers, /, and . e) if possible, information on how to check to see that the image is a valid image file f) not required, but information on how to implement dimension checking would be useful too If anyone could assist me with the best way of doing these, it would be much appreciated. |
#2
|
|||
|
|||
![]()
Even if you can only answer one of these queries, or part of one, any assistance would be appreciated.
|
#3
|
||||
|
||||
![]()
e) Not possible without using PHP to download the image file and then examine it with some image functions from the GD module.
As for the rest, something like this would probably do I think: PHP Code:
|
#4
|
|||
|
|||
![]()
Thank you! I haven't used your code specifically, but it was exactly what I needed to know.
Because this is going in a user profile field, I haven't needed to specifically write php code for it, instead I used the preg_match feature of the user profile field. Below is the characters I am currently allowing, I have added 0-9, ~, _ and - and allowed for a blank entry. PHP Code:
PHP Code:
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|