Small update
[iDB.git] / inc / misc / ibbcode.php
blob30ed68842b0fd18a2ea3cbb5fa85fa3d23137e81
1 <?php
2 /*
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2004-2019 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12 Copyright 2004-2019 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
13 iBBCode / iBBTags by Kazuki Przyborowski - http://idb.berlios.net/
15 $FileInfo: ibbcode.php - Last Update: 08/02/2019 SVN 905 - Author: cooldude2k $
17 $File3Name = basename($_SERVER['SCRIPT_NAME']);
18 if ($File3Name=="ibbcode.php"||$File3Name=="/ibbcode.php") {
19 require('index.php');
20 exit(); }
23 This File has all the Functions for BBTags
24 Thanks for the Help of czambran at:
25 http://www.phpfreaks.com/forums/index.php?action=profile;u=15535
26 */
27 $BoardCharSet = $Settings['charset'];
28 function html_decode($matches) {
29 global $BoardCharSet;
30 $matches[1] = str_replace(array("\r", "\r\n", "\n"), " ", $matches[1]);
31 return html_entity_decode($matches[1], ENT_QUOTES, $BoardCharSet); }
32 function do_html_bbcode($text) {
33 return preg_replace_callback("/\[DoHTML\](.*?)\[\/DoHTML\]/is","html_decode",$text); }
34 function idb_exec_php_handler($buffer) { return $buffer; }
35 function exec_php($matches) {
36 global $BoardCharSet;
37 ob_start("idb_exec_php_handler");
38 $matches[1] = html_entity_decode($matches[1], ENT_QUOTES, $BoardCharSet);
39 @eval("?> ".$matches[1]);
40 return ob_get_clean(); }
41 function php_execute($text) {
42 return preg_replace_callback("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","exec_php",$text); }
43 function bbcode_rot13($matches) {
44 return str_rot13($matches[1]); }
45 function bbcode_base64encode($matches) {
46 return base64_encode($matches[1]); }
47 function bbcode_base64decode($matches) {
48 return base64_decode($matches[1]); }
49 function bbcode_urlencode($matches) {
50 return urlencode($matches[1]); }
51 function bbcode_urldecode($matches) {
52 return urldecode($matches[1]); }
53 function bbcode_date_time($matches) {
54 return $usercurtime->format($matches[1]); }
55 function bbcode_random($matches) {
56 if(!isset($matches[2])) {
57 return rand(0,$matches[1]); }
58 if(isset($matches[2])) {
59 return rand($matches[1],$matches[2]); } }
60 // Pre URL and IMG tags
61 if(!function_exists("urlcheck2")) {
62 function urlcheck2($matches) {
63 global $BoardURL;
64 $retnum = preg_match_all("/([a-zA-Z]+)\:\/\/([a-z0-9\-\.@\:]+)(\:[0-9]+)?\/([A-Za-z0-9\.\/%\?\!\$\(\)\*\-_\:;,\+\@~]+)?(\?)?([A-Za-z0-9\.\/%&\=\?\!\$\(\)\*\-_\:;,\+\@~]+)?(\#)?([A-Za-z0-9\.\/%&\=\?\!\$\(\)\*\-_\:;,\+\@~]+)?/is", $matches[1], $urlcheck);
65 if(isset($urlcheck[0][0])) {
66 $matches[0] = preg_replace("/\[URL\](.*?)\[\/URL\]/is", " \\1", $matches[0]);
67 $matches[0] = preg_replace("/\[URL\=(.*?)\](.*?)\[\/URL\]/is", "<a href=\"\\1\">\\2</a>", $matches[0]);
68 $matches[0] = preg_replace("/\[IMG](.*?)\[\/IMG\]/is", "<img src=\"\\1\" alt=\"user posted image\" title=\"user posted image\" />", $matches[0]);
69 $matches[0] = preg_replace("/\[IMG\=(.*?)]([A-Za-z0-9\.\/%\?\!\$\(\)\*\-_\:;,\+\@~\s]+)\[\/IMG\]/is", "<img src=\"\\1\" alt=\"\\2\" title=\"\\2\" />", $matches[0]); }
70 return $matches[0]; } }
71 function bbcode_parser($text) {
72 global $Settings;
73 $usertz = new DateTimeZone($_SESSION['UserTimeZone']);
74 $usercurtime = new DateTime();
75 $usercurtime->setTimezone($usertz);
76 $text = preg_replace("/\[EmbedVideo\=&quot;([A-Za-z0-9\.\-_]+)&quot;\]([A-Za-z0-9\.\-_]+)\[\/EmbedVideo\]/is", "[\\1]\\2[/\\1]", $text);
77 $text = preg_replace("/\[EmbedVideo\=([A-Za-z0-9\.\-_]+)\]([A-Za-z0-9\.\-_]+)\[\/EmbedVideo\]/is", "[\\1]\\2[/\\1]", $text);
78 $text = preg_replace("/\[EmbedMusic\=&quot;([A-Za-z0-9\.\-_]+)&quot;\]([A-Za-z0-9\.\-_]+)\[\/EmbedMusic\]/is", "[\\1]\\2[/\\1]", $text);
79 $text = preg_replace("/\[EmbedMusic\=([A-Za-z0-9\.\-_]+)\]([A-Za-z0-9\.\-_]+)\[\/EmbedMusic\]/is", "[\\1]\\2[/\\1]", $text);
80 $text = preg_replace("/\[Kiwi6\]([A-Za-z0-9\.\-_]+)\[\/Kiwi6\]/is", "\n<object type=\"application/x-shockwave-flash\" height=\"24\" width=\"290\" data=\"http://kiwi6.com/swf/player.swf\">\n<param name=\"movie\" value=\"http://kiwi6.com/swf/player.swf\" />\n<param name=\"FlashVars\" value=\"playerID=audioplayer&amp;soundFile=http%3A%2F%2Fk003.kiwi6.com%2Fuploads%2Fhotlink%2F\\1\" />\n<param name=\"quality\" value=\"high\" />\n<param name=\"menu\" value=\"false\" />\n<param name=\"allowscriptaccess\" value=\"always\" />\n<param name=\"wmode\" value=\"transparent\" />\n</object>\n", $text);
81 $text = preg_replace("/\[YouTube\]([A-Za-z0-9\.\-_]+)\[\/YouTube\]/is", "\n<object type=\"application/x-shockwave-flash\" width=\"480\" height=\"385\" data=\"http://www.youtube.com/v/\\1?fs=1&amp;hl=en_US\">\n<param name=\"\\1\" value=\"http://www.youtube.com/v/\\1?fs=1&amp;hl=en_US\" />\n</object>\n", $text);
82 $text = preg_replace("/\[DailyMotion\]([A-Za-z0-9\.\-_]+)\[\/DailyMotion\]/is", "\n<object type=\"application/x-shockwave-flash\" width=\"480\" height=\"385\" data=\"http://www.dailymotion.com/swf/video/\\1\">\n<param name=\"\\1\" value=\"http://www.dailymotion.com/swf/video/\\1\" />\n<param name=\"allowFullScreen\" value=\"true\" />\n<param name=\"allowScriptAccess\" value=\"always\" />\n<param name=\"wmode\" value=\"transparent\" />\n</object>\n", $text);
83 $text = preg_replace("/\[Vimeo\]([A-Za-z0-9\.\-_]+)\[\/Vimeo\]/is", "\n<object type=\"application/x-shockwave-flash\" width=\"400\" height=\"225\" data=\"http://vimeo.com/moogaloop.swf?clip_id=\\1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0\">\n<param name=\"\\1\" value=\"http://vimeo.com/moogaloop.swf?clip_id=\\1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0\" />\n<param name=\"allowfullscreen\" value=\"true\" />\n<param name=\"allowscriptaccess\" value=\"always\" />\n</object>\n", $text);
84 $text = preg_replace("/\[TinyPic\]([A-Za-z0-9\.\-_]+)\,([A-Za-z0-9\.\-_]+)\[\/TinyPic\]/is", "<img src=\"http://\\1.tinypic.com/\\2\" alt=\"\\2\" title=\"\\2\" />", $text);
85 $text = preg_replace("/\[BR\]/is", "<br />", $text);
86 $text = preg_replace("/\[HR\]/is", "<hr />", $text);
87 $text = preg_replace("/\[SUP\](.*?)\[\/SUP\]/is", "<sup>\\1</sup>", $text);
88 $text = preg_replace("/\[SUB\](.*?)\[\/SUB\]/is", "<sub>\\1</sub>", $text);
89 $text = preg_replace("/\[BoardName\]/is", $Settings['board_name'], $text);
90 $text = preg_replace("/\[BoardURL\]/is", $Settings['idburl'], $text);
91 $text = preg_replace("/\[WebSiteURL\]/is", $Settings['weburl'], $text);
92 $text = preg_replace("/\{BoardName\}/is", $Settings['board_name'], $text);
93 $text = preg_replace("/\{BoardURL\}/is", $Settings['idburl'], $text);
94 $text = preg_replace("/\{WebSiteURL\}/is", $Settings['weburl'], $text);
95 $text = preg_replace("/\[DATE\]/is", $usercurtime->format('M j Y'), $text);
96 //$text = preg_replace("/\[DATE\=(.*?)\]/is", $usercurtime->format("${1}"), $text);
97 $text = preg_replace("/\[TIME\]/is", $usercurtime->format('g:i a'), $text);
98 //$text = preg_replace("/\[TIME\=(.*?)\]/is", $usercurtime->format("${1}"), $text);
99 $text = preg_replace_callback("/\[DATE\=&quot;(.*?)&quot;\]/is", "bbcode_date_time", $text);
100 $text = preg_replace_callback("/\[TIME\=&quot;(.*?)&quot;\]/is", "bbcode_date_time", $text);
101 $text = preg_replace_callback("/\[DATE\=(.*?)\]/is", "bbcode_date_time", $text);
102 $text = preg_replace_callback("/\[TIME\=(.*?)\]/is", "bbcode_date_time", $text);
103 $text = preg_replace("/\{DATE\}/is", $usercurtime->format('g:i a'), $text);
104 //$text = preg_replace("/\{DATE\=(.*?)\}/is", $usercurtime->format("${1}"), $text);
105 $text = preg_replace("/\{TIME\}/is", $usercurtime->format('M j Y'), $text);
106 //$text = preg_replace("/\{TIME\=(.*?)\}/is", $usercurtime->format("${1}"), $text);
107 $text = preg_replace_callback("/\{DATE\=&quot;(.*?)\"\}/is", "bbcode_date_time", $text);
108 $text = preg_replace_callback("/\{TIME\=&quot;(.*?)\"\}/is", "bbcode_date_time", $text);
109 $text = preg_replace_callback("/\[RAND\=&quot;([\-]?[0-9]+)&quot;\]/is", "bbcode_random", $text);
110 $text = preg_replace_callback("/\[RAND\=&quot;([\-]?[0-9]+)&quot;,&quot;([\-]?[0-9]+)&quot;\]/is", "bbcode_random", $text);
111 $text = preg_replace_callback("/\[RAND\=&quot;([\-]?[0-9]+),([\-]?[0-9]+)&quot;\]/is", "bbcode_random", $text);
112 $text = preg_replace_callback("/\{RAND\=&quot;([\-]?[0-9]+)\"\}/is", "bbcode_random", $text);
113 $text = preg_replace_callback("/\{RAND\=&quot;([\-]?[0-9]+),([\-]?[0-9]+)\"\}/is", "bbcode_random", $text);
114 $text = preg_replace("/\[Entity\=&quot;([A-Za-z0-9\#]+)&quot;\]/is", "&\\1;", $text);
115 $text = preg_replace("/\{Entity\=&quot;([A-Za-z0-9\#]+)\"\}/is", "&\\1;", $text);
116 $text = preg_replace_callback("/\{DATE\=(.*?)\}/is", "bbcode_date_time", $text);
117 $text = preg_replace_callback("/\{TIME\=(.*?)\}/is", "bbcode_date_time", $text);
118 $text = preg_replace_callback("/\[RAND\=([\-]?[0-9]+)\]/is", "bbcode_random", $text);
119 $text = preg_replace_callback("/\[RAND\=([\-]?[0-9]+),([\-]?[0-9]+)\]/is", "bbcode_random", $text);
120 $text = preg_replace_callback("/\{RAND\=([\-]?[0-9]+)\}/is", "bbcode_random", $text);
121 $text = preg_replace_callback("/\{RAND\=([\-]?[0-9]+),([\-]?[0-9]+)\}/is", "bbcode_random", $text);
122 $text = preg_replace("/\[Entity\=([A-Za-z0-9\#]+)\]/is", "&\\1;", $text);
123 $text = preg_replace("/\{Entity\=([A-Za-z0-9\#]+)\}/is", "&\\1;", $text);
124 $text = preg_replace("/\[B\](.*?)\[\/B\]/is", "<span style=\"font-weight: bold;\">\\1</span>", $text);
125 $text = preg_replace("/\[BOLD\](.*?)\[\/BOLD\]/is", "<span style=\"font-weight: bold;\">\\1</span>", $text);
126 $text = preg_replace("/\[I\](.*?)\[\/I\]/is", "<span style=\"font-style: italic;\">\\1</span>", $text);
127 $text = preg_replace("/\[ITALIC\](.*?)\[\/ITALIC\]/is", "<span style=\"font-style: italic;\">\\1</span>", $text);
128 $text = preg_replace("/\[OBLIQUE\](.*?)\[\/OBLIQUE\]/is", "<span style=\"font-style: oblique;\">\\1</span>", $text);
129 $text = preg_replace("/\[S\](.*?)\[\/S\]/is", "<span style=\"font-style: strike;\">\\1</span>", $text);
130 $text = preg_replace("/\[STRIKE\](.*?)\[\/STRIKE\]/is", "<span style=\"font-style: strike;\">\\1</span>", $text);
131 $text = preg_replace("/\[U\](.*?)\[\/U\]/is", "<span style=\"text-decoration: underline;\">\\1</span>", $text);
132 $text = preg_replace("/\[O\](.*?)\[\/O\]/is", "<span style=\"text-decoration: overline;\">\\1</span>", $text);
133 $text = preg_replace("/\[CENTER\](.*?)\[\/CENTER\]/is", "<span style=\"text-align: center;\">\\1</span>", $text);
134 $text = preg_replace("/\[LTR\](.*?)\[\/LTR\]/is", "<span style=\"direction: rtl;\">\\1</span>", $text);
135 $text = preg_replace("/\[FONT\=&quot;([A-Za-z0-9\,\s]+)&quot;\](.*?)\[\/FONT\]/is", "<span style=\"font-family: \\1px;\">\\2</span>", $text);
136 $text = preg_replace("/\[DIV\=&quot;([A-Za-z0-9,\.%\-_\:;~\(\)#\s]+)&quot;\](.*?)\[\/DIV\]/is", "<div style=\"\\1\">\\2</div>", $text);
137 $text = preg_replace("/\[SPAN\=&quot;([A-Za-z0-9,\.%\-_\:;~\(\)#\s]+)&quot;\](.*?)\[\/SPAN\]/is", "<span style=\"\\1\">\\2</span>", $text);
138 $text = preg_replace("/\[SIZE\=&quot;([0-9]+)&quot;\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1px;\">\\2</span>", $text);
139 $text = preg_replace("/\[SIZE\=&quot;([0-9]+)\%&quot;\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1%;\">\\2</span>", $text);
140 $text = preg_replace("/\[SIZE\=&quot;([0-9]+)(em|pt|px)&quot;\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1\\2;\">\\3</span>", $text);
141 $text = preg_replace("/\[COLOR\=&quot;([A-Za-z0-9]+)&quot;\](.*?)\[\/COLOR\]/is", "<span style=\"color: \\1;\">\\2</span>", $text);
142 $text = preg_replace("/\[COLOR\=&quot;\#([A-Za-z0-9]+)&quot;\](.*?)\[\/COLOR\]/is", "<span style=\"color: #\\1;\">\\2</span>", $text);
143 $text = preg_replace("/\[COLOR\=&quot;rgb\(([0-9\,\s]+)\"\)\](.*?)\[\/COLOR\]/is", "<span style=\"color: rgb(\\1);\">\\2</span>", $text);
144 $text = preg_replace("/\[BGCOLOR\=&quot;([A-Za-z0-9]+)&quot;\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: \\1;\">\\2</span>", $text);
145 $text = preg_replace("/\[BGCOLOR\=&quot;\#([A-Za-z0-9]+)&quot;\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: #\\1;\">\\2</span>", $text);
146 $text = preg_replace("/\[BGCOLOR\=&quot;rgb\(([0-9\,\s]+)\"\)\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: rgb(\\1);\">\\2</span>", $text);
147 $text = preg_replace("/\[COLOUR\=&quot;([A-Za-z0-9]+)&quot;\](.*?)\[\/COLOUR\]/is", "<span style=\"color: \\1;\">\\2</span>", $text);
148 $text = preg_replace("/\[COLOUR\=&quot;\#([A-Za-z0-9]+)&quot;\](.*?)\[\/COLOUR\]/is", "<span style=\"color: #\\1;\">\\2</span>", $text);
149 $text = preg_replace("/\[COLOUR\=&quot;rgb\(([0-9\,\s]+)\"\)\](.*?)\[\/COLOUR\]/is", "<span style=\"color: rgb(\\1);\">\\2</span>", $text);
150 $text = preg_replace("/\[BGCOLOUR\=&quot;([A-Za-z0-9]+)&quot;\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: \\1;\">\\2</span>", $text);
151 $text = preg_replace("/\[BGCOLOUR\=&quot;\#([A-Za-z0-9]+)&quot;\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: #\\1;\">\\2</span>", $text);
152 $text = preg_replace("/\[BGCOLOUR\=&quot;rgb\(([0-9\,\s]+)\"\)\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: rgb(\\1);\">\\2</span>", $text);
153 $text = preg_replace("/\[ALIGN=\"(left|center|right|justify)&quot;\](.*?)\[\/ALIGN\]/is", "<div style=\"text-align: \\1;\">\\2</div>", $text);
154 $text = preg_replace("/\[VALIGN=\"(.*?)&quot;\](.*?)\[\/VALIGN\]/is", "<div style=\"vertical-align: \\1;\">\\2</div>", $text);
155 $text = preg_replace("/\[FLOAT=\"(left|right)&quot;\](.*?)\[\/FLOAT\]/is", "<div style=\"float: \\1;\">\\2</div>", $text);
156 $text = preg_replace("/\[FONT\=([A-Za-z0-9\,\s]+)\](.*?)\[\/FONT\]/is", "<span style=\"font-family: \\1px;\">\\2</span>", $text);
157 $text = preg_replace("/\[DIV\=([A-Za-z0-9,\.%\-_\:;~\(\)#\s]+)\](.*?)\[\/DIV\]/is", "<div style=\"\\1\">\\2</div>", $text);
158 $text = preg_replace("/\[SPAN\=([A-Za-z0-9,\.%\-_\:;~\(\)#\s]+)\](.*?)\[\/SPAN\]/is", "<span style=\"\\1\">\\2</span>", $text);
159 $text = preg_replace("/\[COMMENT\](.*?)\[COMMENT\]/is", "<!--\\1-->", $text);
160 $text = preg_replace("/\[SIZE\=([0-9]+)\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1px;\">\\2</span>", $text);
161 $text = preg_replace("/\[SIZE\=([0-9]+)\%\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1%;\">\\2</span>", $text);
162 $text = preg_replace("/\[SIZE\=([0-9]+)(em|pt|px)\](.*?)\[\/SIZE\]/is", "<span style=\"font-size: \\1\\2;\">\\3</span>", $text);
163 $text = preg_replace("/\[COLOR\=([A-Za-z0-9]+)\](.*?)\[\/COLOR\]/is", "<span style=\"color: \\1;\">\\2</span>", $text);
164 $text = preg_replace("/\[COLOR\=\#([A-Za-z0-9]+)\](.*?)\[\/COLOR\]/is", "<span style=\"color: #\\1;\">\\2</span>", $text);
165 $text = preg_replace("/\[COLOR\=rgb\(([0-9\,\s]+)\)\](.*?)\[\/COLOR\]/is", "<span style=\"color: rgb(\\1);\">\\2</span>", $text);
166 $text = preg_replace("/\[BGCOLOR\=([A-Za-z0-9]+)\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: \\1;\">\\2</span>", $text);
167 $text = preg_replace("/\[BGCOLOR\=\#([A-Za-z0-9]+)\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: #\\1;\">\\2</span>", $text);
168 $text = preg_replace("/\[BGCOLOR\=rgb\(([0-9\,\s]+)\)\](.*?)\[\/BGCOLOR\]/is", "<span style=\"background-color: rgb(\\1);\">\\2</span>", $text);
169 $text = preg_replace("/\[COLOUR\=([A-Za-z0-9]+)\](.*?)\[\/COLOUR\]/is", "<span style=\"color: \\1;\">\\2</span>", $text);
170 $text = preg_replace("/\[COLOUR\=\#([A-Za-z0-9]+)\](.*?)\[\/COLOUR\]/is", "<span style=\"color: #\\1;\">\\2</span>", $text);
171 $text = preg_replace("/\[COLOUR\=rgb\(([0-9\,\s]+)\)\](.*?)\[\/COLOUR\]/is", "<span style=\"color: rgb(\\1);\">\\2</span>", $text);
172 $text = preg_replace("/\[BGCOLOUR\=([A-Za-z0-9]+)\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: \\1;\">\\2</span>", $text);
173 $text = preg_replace("/\[BGCOLOUR\=\#([A-Za-z0-9]+)\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: #\\1;\">\\2</span>", $text);
174 $text = preg_replace("/\[BGCOLOUR\=rgb\(([0-9\,\s]+)\)\](.*?)\[\/BGCOLOUR\]/is", "<span style=\"background-color: rgb(\\1);\">\\2</span>", $text);
175 $text = preg_replace("/\[ALIGN=(left|center|right|justify)\](.*?)\[\/ALIGN\]/is", "<div style=\"text-align: \\1;\">\\2</div>", $text);
176 $text = preg_replace("/\[VALIGN=(.*?)\](.*?)\[\/VALIGN\]/is", "<div style=\"vertical-align: \\1;\">\\2</div>", $text);
177 $text = preg_replace("/\[FLOAT=(left|right)\](.*?)\[\/FLOAT\]/is", "<div style=\"float: \\1;\">\\2</div>", $text);
178 // Sub URL and IMG tags
179 $text = preg_replace_callback("/\[URL](.*?)\[\/URL\]/is", "urlcheck2", $text);
180 $text = preg_replace("/\[URL\=&quot;(.*?)&quot;\](.*?)\[\/URL\]/is", "[URL=\\1]\\2[/URL]", $text);
181 $text = preg_replace_callback("/\[URL\=(.*?)\](.*?)\[\/URL\]/is", "urlcheck2", $text);
182 $text = preg_replace_callback("/\[IMG](.*?)\[\/IMG\]/is", "urlcheck2", $text);
183 $text = preg_replace("/\[IMG\=&quot;(.*?)&quot;\](.*?)\[\/IMG\]/is", "[IMG=\\1]\\2[/IMG]", $text);
184 $text = preg_replace_callback("/\[IMG\=(.*?)](.*?)\[\/IMG\]/is", "urlcheck2", $text);
185 $text = preg_replace_callback("/\[URLENCODE\](.*?)\[\/URLENCODE\]/is","bbcode_urlencode",$text);
186 $text = preg_replace_callback("/\[URLDECODE\](.*?)\[\/URLDECODE\]/is","bbcode_urldecode",$text);
187 $text = preg_replace_callback("/\[BASE64\](.*?)\[\/BASE64\]/is","bbcode_base64encode",$text);
188 $text = preg_replace_callback("/\[BASE64\=ENCODE\](.*?)\[\/BASE64\]/is","bbcode_base64encode",$text);
189 $text = preg_replace_callback("/\[BASE64\=DECODE\](.*?)\[\/BASE64\]/is","bbcode_base64decode",$text);
190 $text = preg_replace_callback("/\[ROT13\](.*?)\[\/ROT13\]/is","bbcode_rot13",$text);
191 $text = preg_replace("/\[JavaScript\](.*?)\[\/JavaScript\]/is","[DoHTML]\n&lt;script type=&quot;text/javascript&quot;&gt;\n\\1\n&lt;/script&gt;\n[/DoHTML]",$text);
192 return $text; }
193 function ibbcode_parser($text) { return bbcode_parser($text); }