Jenta
05-05-2005, 12:30 AM
to prevent hotlinking to unauthorized domains im trying to limit the img tag to only a couple
mysite.com and somefreeimagesite.com
functions_bbcodeparse.php, you have this
// do https://vborg.vbsupport.ru/
$bbcode = preg_replace('#\[img\]\s*(https?://([^<>*"' . iif(!$vboptions['allowdynimg'], '?&') . ']+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_img_match('\\1')", $bbcode);
i have modified it to this and it makes it so only mysite.com will work
(added www.mysite.com after the http:// part )
// do https://vborg.vbsupport.ru/
$bbcode = preg_replace('#\\s*(http://www.mysite.com([^<>*"' . iif(!$vboptions['allowdynimg'], '?&') . ']+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_img_match('\\1')", $bbcode);
how would i go about adding an additional domain?
the urls from the 2nd domain are in this format: http://img(somenumbers and other stuff).cx
just making it work with http://img will be fine if thats all that can be done
ideally, i would like for it to jumble up anything posted that does not fit the two formats
like if someone does [img]http://google.com/image.type it will not parse it but will also replace it with some random characters like
hqroiqrq9212o424229uy92r2252
mysite.com and somefreeimagesite.com
functions_bbcodeparse.php, you have this
// do https://vborg.vbsupport.ru/
$bbcode = preg_replace('#\[img\]\s*(https?://([^<>*"' . iif(!$vboptions['allowdynimg'], '?&') . ']+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_img_match('\\1')", $bbcode);
i have modified it to this and it makes it so only mysite.com will work
(added www.mysite.com after the http:// part )
// do https://vborg.vbsupport.ru/
$bbcode = preg_replace('#\\s*(http://www.mysite.com([^<>*"' . iif(!$vboptions['allowdynimg'], '?&') . ']+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_img_match('\\1')", $bbcode);
how would i go about adding an additional domain?
the urls from the 2nd domain are in this format: http://img(somenumbers and other stuff).cx
just making it work with http://img will be fine if thats all that can be done
ideally, i would like for it to jumble up anything posted that does not fit the two formats
like if someone does [img]http://google.com/image.type it will not parse it but will also replace it with some random characters like
hqroiqrq9212o424229uy92r2252