Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Handles a match of the [img] tag that will be displayed as an actual image.
- *
- * @param string The URL to the image.
- *
- * @return string HTML representation of the tag.
- */
- function handle_bbcode_img_match($link)
- {
- $link = $this->strip_smilies(str_replace('\\"', '"', $link));
- // remove double spaces -- fixes issues with wordwrap
- $link = str_replace(array(' ', '"'), '', $link);
- $whitelist = array(
- "savepic.net",
- "savepic.ru",
- "hostingkartinok.com",
- "imglink.ru",
- "imageshost.ru",
- "pixshock.net",
- "radikal.ru",
- "saveimg.ru",
- "ipicture.ru",
- "jpg1.ru",
- "imagepost.ru",
- "jpeghost.ru",
- "impic.ru",
- "fastpic.ru",
- "imgex.com",
- "pictureshack.ru",
- "keep4u.ru",
- "myphotoalbum.ru",
- "4put.ru",
- "xmages.net",
- "lostpic.net");
- $host = parse_url($link, PHP_URL_HOST);
- if(substr($host, 0, 4) == "www.")
- {
- $host = str_replace("www.", "", $host);
- }
- if (in_array($host, $whitelist)) {
- return '<img src="' . $link . '" border="0" alt="" />';
- }
- else
- {
- return '<p style="color: red;">Please upload your picture at a trusted hoster. For: savepic.net, radikal.ru, ipicture.ru, fastpic.ru, etc</p>';
- }
- }
- /*======================================================================*\
- || #################################################################### ||
- || # ---------------------- Xaker.Name ------------------------------ # ||
- \*======================================================================*/
Advertisement
Add Comment
Please, Sign In to add comment