Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
acp_bbcodes.php
001 <?php
002 /**
003 *
004 * This file is part of the phpBB Forum Software package.
005 *
006 * @copyright (c) phpBB Limited <https://www.phpbb.com>
007 * @license GNU General Public License, version 2 (GPL-2.0)
008 *
009 * For full copyright and license information, please see
010 * the docs/CREDITS.txt file.
011 *
012 */
013
014 /**
015 * @ignore
016 */
017 if (!defined('IN_PHPBB'))
018 {
019 exit;
020 }
021
022 class acp_bbcodes
023 {
024 var $u_action;
025
026 function main($id, $mode)
027 {
028 global $db, $user, $template, $cache, $request, $phpbb_dispatcher, $phpbb_container;
029 global $phpbb_log;
030
031 $user->add_lang('acp/posting');
032
033 // Set up general vars
034 $action = $request->variable('action', '');
035 $bbcode_id = $request->variable('bbcode', 0);
036 $submit = $request->is_set_post('submit');
037
038 $this->tpl_name = 'acp_bbcodes';
039 $this->page_title = 'ACP_BBCODES';
040 $form_key = 'acp_bbcodes';
041
042 add_form_key($form_key);
043
044 if ($submit && !check_form_key($form_key))
045 {
046 trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
047 }
048
049 // Set up mode-specific vars
050 switch ($action)
051 {
052 case 'add':
053 $bbcode_match = $bbcode_tpl = $bbcode_helpline = '';
054 $display_on_posting = 0;
055 break;
056
057 case 'edit':
058 $sql = 'SELECT bbcode_match, bbcode_tpl, display_on_posting, bbcode_helpline
059 FROM ' . BBCODES_TABLE . '
060 WHERE bbcode_id = ' . $bbcode_id;
061 $result = $db->sql_query($sql);
062 $row = $db->sql_fetchrow($result);
063 $db->sql_freeresult($result);
064
065 if (!$row)
066 {
067 trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
068 }
069
070 $bbcode_match = $row['bbcode_match'];
071 $bbcode_tpl = htmlspecialchars($row['bbcode_tpl']);
072 $display_on_posting = $row['display_on_posting'];
073 $bbcode_helpline = $row['bbcode_helpline'];
074 break;
075
076 case 'modify':
077 $sql = 'SELECT bbcode_id, bbcode_tag
078 FROM ' . BBCODES_TABLE . '
079 WHERE bbcode_id = ' . $bbcode_id;
080 $result = $db->sql_query($sql);
081 $row = $db->sql_fetchrow($result);
082 $db->sql_freeresult($result);
083
084 if (!$row)
085 {
086 trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
087 }
088
089 // No break here
090
091 case 'create':
092 $display_on_posting = $request->variable('display_on_posting', 0);
093
094 $bbcode_match = $request->variable('bbcode_match', '');
095 $bbcode_tpl = htmlspecialchars_decode($request->variable('bbcode_tpl', '', true));
096 $bbcode_helpline = $request->variable('bbcode_helpline', '', true);
097 break;
098 }
099
100 // Do major work
101 switch ($action)
102 {
103 case 'edit':
104 case 'add':
105
106 $tpl_ary = array(
107 'S_EDIT_BBCODE' => true,
108 'U_BACK' => $this->u_action,
109 'U_ACTION' => $this->u_action . '&action=' . (($action == 'add') ? 'create' : 'modify') . (($bbcode_id) ? "&bbcode=$bbcode_id" : ''),
110
111 'L_BBCODE_USAGE_EXPLAIN'=> sprintf($user->lang['BBCODE_USAGE_EXPLAIN'], '<a href="#down">', '</a>'),
112 'BBCODE_MATCH' => $bbcode_match,
113 'BBCODE_TPL' => $bbcode_tpl,
114 'BBCODE_HELPLINE' => $bbcode_helpline,
115 'DISPLAY_ON_POSTING' => $display_on_posting,
116 );
117
118 $bbcode_tokens = array('TEXT', 'SIMPLETEXT', 'INTTEXT', 'IDENTIFIER', 'NUMBER', 'EMAIL', 'URL', 'LOCAL_URL', 'RELATIVE_URL', 'COLOR');
119
120 /**
121 * Modify custom bbcode template data before we display the add/edit form
122 *
123 * @event core.acp_bbcodes_edit_add
124 * @var string action Type of the action: add|edit
125 * @var array tpl_ary Array with custom bbcode add/edit data
126 * @var int bbcode_id When editing: the bbcode id,
127 * when creating: 0
128 * @var array bbcode_tokens Array of bbcode tokens
129 * @since 3.1.0-a3
130 */
131 $vars = array('action', 'tpl_ary', 'bbcode_id', 'bbcode_tokens');
132 extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_edit_add', compact($vars)));
133
134 $template->assign_vars($tpl_ary);
135
136 foreach ($bbcode_tokens as $token)
137 {
138 $template->assign_block_vars('token', array(
139 'TOKEN' => '{' . $token . '}',
140 'EXPLAIN' => ($token === 'LOCAL_URL') ? $user->lang(array('tokens', $token), generate_board_url() . '/') : $user->lang(array('tokens', $token)),
141 ));
142 }
143
144 return;
145
146 break;
147
148 case 'modify':
149 case 'create':
150
151 $sql_ary = $hidden_fields = array();
152
153 /**
154 * Modify custom bbcode data before the modify/create action
155 *
156 * @event core.acp_bbcodes_modify_create
157 * @var string action Type of the action: modify|create
158 * @var array sql_ary Array with new bbcode data
159 * @var int bbcode_id When editing: the bbcode id,
160 * when creating: 0
161 * @var bool display_on_posting Display bbcode on posting form
162 * @var string bbcode_match The bbcode usage string to match
163 * @var string bbcode_tpl The bbcode HTML replacement string
164 * @var string bbcode_helpline The bbcode help line string
165 * @var array hidden_fields Array of hidden fields for use when
166 * submitting form when $warn_text is true
167 * @since 3.1.0-a3
168 */
169 $vars = array(
170 'action',
171 'sql_ary',
172 'bbcode_id',
173 'display_on_posting',
174 'bbcode_match',
175 'bbcode_tpl',
176 'bbcode_helpline',
177 'hidden_fields',
178 );
179 extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_modify_create', compact($vars)));
180
181 $warn_text = preg_match('%<[^>]*\{text[\d]*\}[^>]*>%i', $bbcode_tpl);
182 if (!$warn_text || confirm_box(true))
183 {
184 $data = $this->build_regexp($bbcode_match, $bbcode_tpl);
185
186 // Make sure the user didn't pick a "bad" name for the BBCode tag.
187 $hard_coded = array('code', 'quote', 'quote=', 'attachment', 'attachment=', 'b', 'i', 'url', 'url=', 'img', 'size', 'size=', 'color', 'color=', 'u', 'list', 'list=', 'email', 'email=', 'flash', 'flash=');
188
189 if (($action == 'modify' && strtolower($data['bbcode_tag']) !== strtolower($row['bbcode_tag'])) || ($action == 'create'))
190 {
191 $sql = 'SELECT 1 as test
192 FROM ' . BBCODES_TABLE . "
193 WHERE LOWER(bbcode_tag) = '" . $db->sql_escape(strtolower($data['bbcode_tag'])) . "'";
194 $result = $db->sql_query($sql);
195 $info = $db->sql_fetchrow($result);
196 $db->sql_freeresult($result);
197
198 // Grab the end, interrogate the last closing tag
199 if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded) || (preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs) && in_array(strtolower($regs[1]), $hard_coded)))
200 {
201 trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING);
202 }
203 }
204
205 if (substr($data['bbcode_tag'], -1) === '=')
206 {
207 $test = substr($data['bbcode_tag'], 0, -1);
208 }
209 else
210 {
211 $test = $data['bbcode_tag'];
212 }
213
214 if (!preg_match('%\\[' . $test . '[^]]*].*?\\[/' . $test . ']%s', $bbcode_match))
215 {
216 trigger_error($user->lang['BBCODE_OPEN_ENDED_TAG'] . adm_back_link($this->u_action), E_USER_WARNING);
217 }
218
219 if (strlen($data['bbcode_tag']) > 16)
220 {
221 trigger_error($user->lang['BBCODE_TAG_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
222 }
223
224 if (strlen($bbcode_match) > 4000)
225 {
226 trigger_error($user->lang['BBCODE_TAG_DEF_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
227 }
228
229 if (strlen($bbcode_helpline) > 255)
230 {
231 trigger_error($user->lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
232 }
233
234 $sql_ary = array_merge($sql_ary, array(
235 'bbcode_tag' => $data['bbcode_tag'],
236 'bbcode_match' => $bbcode_match,
237 'bbcode_tpl' => $bbcode_tpl,
238 'display_on_posting' => $display_on_posting,
239 'bbcode_helpline' => $bbcode_helpline,
240 'first_pass_match' => $data['first_pass_match'],
241 'first_pass_replace' => $data['first_pass_replace'],
242 'second_pass_match' => $data['second_pass_match'],
243 'second_pass_replace' => $data['second_pass_replace']
244 ));
245
246 if ($action == 'create')
247 {
248 $sql = 'SELECT MAX(bbcode_id) as max_bbcode_id
249 FROM ' . BBCODES_TABLE;
250 $result = $db->sql_query($sql);
251 $row = $db->sql_fetchrow($result);
252 $db->sql_freeresult($result);
253
254 if ($row)
255 {
256 $bbcode_id = $row['max_bbcode_id'] + 1;
257
258 // Make sure it is greater than the core bbcode ids...
259 if ($bbcode_id <= NUM_CORE_BBCODES)
260 {
261 $bbcode_id = NUM_CORE_BBCODES + 1;
262 }
263 }
264 else
265 {
266 $bbcode_id = NUM_CORE_BBCODES + 1;
267 }
268
269 if ($bbcode_id > BBCODE_LIMIT)
270 {
271 trigger_error($user->lang['TOO_MANY_BBCODES'] . adm_back_link($this->u_action), E_USER_WARNING);
272 }
273
274 $sql_ary['bbcode_id'] = (int) $bbcode_id;
275
276 $db->sql_query('INSERT INTO ' . BBCODES_TABLE . $db->sql_build_array('INSERT', $sql_ary));
277 $cache->destroy('sql', BBCODES_TABLE);
278 $phpbb_container->get('text_formatter.cache')->invalidate();
279
280 $lang = 'BBCODE_ADDED';
281 $log_action = 'LOG_BBCODE_ADD';
282 }
283 else
284 {
285 $sql = 'UPDATE ' . BBCODES_TABLE . '
286 SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
287 WHERE bbcode_id = ' . $bbcode_id;
288 $db->sql_query($sql);
289 $cache->destroy('sql', BBCODES_TABLE);
290 $phpbb_container->get('text_formatter.cache')->invalidate();
291
292 $lang = 'BBCODE_EDITED';
293 $log_action = 'LOG_BBCODE_EDIT';
294 }
295
296 $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log_action, false, array($data['bbcode_tag']));
297
298 trigger_error($user->lang[$lang] . adm_back_link($this->u_action));
299 }
300 else
301 {
302 confirm_box(false, $user->lang['BBCODE_DANGER'], build_hidden_fields(array_merge($hidden_fields, array(
303 'action' => $action,
304 'bbcode' => $bbcode_id,
305 'bbcode_match' => $bbcode_match,
306 'bbcode_tpl' => htmlspecialchars($bbcode_tpl),
307 'bbcode_helpline' => $bbcode_helpline,
308 'display_on_posting' => $display_on_posting,
309 )))
310 , 'confirm_bbcode.html');
311 }
312
313 break;
314
315 case 'delete':
316
317 $sql = 'SELECT bbcode_tag
318 FROM ' . BBCODES_TABLE . "
319 WHERE bbcode_id = $bbcode_id";
320 $result = $db->sql_query($sql);
321 $row = $db->sql_fetchrow($result);
322 $db->sql_freeresult($result);
323
324 if ($row)
325 {
326 if (confirm_box(true))
327 {
328 $db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
329 $cache->destroy('sql', BBCODES_TABLE);
330 $phpbb_container->get('text_formatter.cache')->invalidate();
331 $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_BBCODE_DELETE', false, array($row['bbcode_tag']));
332
333 if ($request->is_ajax())
334 {
335 $json_response = new \phpbb\json_response;
336 $json_response->send(array(
337 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
338 'MESSAGE_TEXT' => $user->lang['BBCODE_DELETED'],
339 'REFRESH_DATA' => array(
340 'time' => 3
341 )
342 ));
343 }
344 }
345 else
346 {
347 confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
348 'bbcode' => $bbcode_id,
349 'i' => $id,
350 'mode' => $mode,
351 'action' => $action))
352 );
353 }
354 }
355
356 break;
357 }
358
359 $u_action = $this->u_action;
360
361 $template_data = array(
362 'U_ACTION' => $this->u_action . '&action=add',
363 );
364
365 $sql_ary = array(
366 'SELECT' => 'b.*',
367 'FROM' => array(BBCODES_TABLE => 'b'),
368 'ORDER_BY' => 'b.bbcode_tag',
369 );
370
371 /**
372 * Modify custom bbcode template data before we display the form
373 *
374 * @event core.acp_bbcodes_display_form
375 * @var string action Type of the action: modify|create
376 * @var array sql_ary The SQL array to get custom bbcode data
377 * @var array template_data Array with form template data
378 * @var string u_action The u_action link
379 * @since 3.1.0-a3
380 */
381 $vars = array('action', 'sql_ary', 'template_data', 'u_action');
382 extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_form', compact($vars)));
383
384 $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
385
386 $template->assign_vars($template_data);
387
388 while ($row = $db->sql_fetchrow($result))
389 {
390 $bbcodes_array = array(
391 'BBCODE_TAG' => $row['bbcode_tag'],
392 'U_EDIT' => $u_action . '&action=edit&bbcode=' . $row['bbcode_id'],
393 'U_DELETE' => $u_action . '&action=delete&bbcode=' . $row['bbcode_id'],
394 );
395
396 /**
397 * Modify display of custom bbcodes in the form
398 *
399 * @event core.acp_bbcodes_display_bbcodes
400 * @var array row Array with current bbcode data
401 * @var array bbcodes_array Array of bbcodes template data
402 * @var string u_action The u_action link
403 * @since 3.1.0-a3
404 */
405 $vars = array('bbcodes_array', 'row', 'u_action');
406 extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_bbcodes', compact($vars)));
407
408 $template->assign_block_vars('bbcodes', $bbcodes_array);
409
410 }
411 $db->sql_freeresult($result);
412 }
413
414 /*
415 * Build regular expression for custom bbcode
416 */
417 function build_regexp(&$bbcode_match, &$bbcode_tpl)
418 {
419 $bbcode_match = trim($bbcode_match);
420 $bbcode_tpl = trim($bbcode_tpl);
421
422 // Allow unicode characters for URL|LOCAL_URL|RELATIVE_URL|INTTEXT tokens
423 $utf8 = preg_match('/(URL|LOCAL_URL|RELATIVE_URL|INTTEXT)/', $bbcode_match);
424
425 $fp_match = preg_quote($bbcode_match, '!');
426 $fp_replace = preg_replace('#^\[(.*?)\]#', '[$1:$uid]', $bbcode_match);
427 $fp_replace = preg_replace('#\[/(.*?)\]$#', '[/$1:$uid]', $fp_replace);
428
429 $sp_match = preg_quote($bbcode_match, '!');
430 $sp_match = preg_replace('#^\\\\\[(.*?)\\\\\]#', '\[$1:$uid\]', $sp_match);
431 $sp_match = preg_replace('#\\\\\[/(.*?)\\\\\]$#', '\[/$1:$uid\]', $sp_match);
432 $sp_replace = $bbcode_tpl;
433
434 // @todo Make sure to change this too if something changed in message parsing
435 $tokens = array(
436 'URL' => array(
437 '!(?:(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('url')) . ')|(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('www_url')) . '))!ie' => "\$this->bbcode_specialchars(('\$1') ? '\$1' : 'http://\$2')"
438 ),
439 'LOCAL_URL' => array(
440 '!(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')!e' => "\$this->bbcode_specialchars('$1')"
441 ),
442 'RELATIVE_URL' => array(
443 '!(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')!e' => "\$this->bbcode_specialchars('$1')"
444 ),
445 'EMAIL' => array(
446 '!(' . get_preg_expression('email') . ')!ie' => "\$this->bbcode_specialchars('$1')"
447 ),
448 'TEXT' => array(
449 '!(.*?)!es' => "str_replace(array(\"\\r\\n\", '\\\"', '\\'', '(', ')'), array(\"\\n\", '\"', ''', '(', ')'), trim('\$1'))"
450 ),
451 'SIMPLETEXT' => array(
452 '!([a-zA-Z0-9-+.,_ ]+)!' => "$1"
453 ),
454 'INTTEXT' => array(
455 '!([\p{L}\p{N}\-+,_. ]+)!u' => "$1"
456 ),
457 'IDENTIFIER' => array(
458 '!([a-zA-Z0-9-_]+)!' => "$1"
459 ),
460 'COLOR' => array(
461 '!([a-z]+|#[0-9abcdef]+)!i' => '$1'
462 ),
463 'NUMBER' => array(
464 '!([0-9]+)!' => '$1'
465 )
466 );
467
468 $sp_tokens = array(
469 'URL' => '(?i)((?:' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('url')) . ')|(?:' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('www_url')) . '))(?-i)',
470 'LOCAL_URL' => '(?i)(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')(?-i)',
471 'RELATIVE_URL' => '(?i)(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')(?-i)',
472 'EMAIL' => '(' . get_preg_expression('email') . ')',
473 'TEXT' => '(.*?)',
474 'SIMPLETEXT' => '([a-zA-Z0-9-+.,_ ]+)',
475 'INTTEXT' => '([\p{L}\p{N}\-+,_. ]+)',
476 'IDENTIFIER' => '([a-zA-Z0-9-_]+)',
477 'COLOR' => '([a-zA-Z]+|#[0-9abcdefABCDEF]+)',
478 'NUMBER' => '([0-9]+)',
479 );
480
481 $pad = 0;
482 $modifiers = 'i';
483 $modifiers .= ($utf8) ? 'u' : '';
484
485 if (preg_match_all('/\{(' . implode('|', array_keys($tokens)) . ')[0-9]*\}/i', $bbcode_match, $m))
486 {
487 foreach ($m[0] as $n => $token)
488 {
489 $token_type = $m[1][$n];
490
491 reset($tokens[strtoupper($token_type)]);
492 list($match, $replace) = each($tokens[strtoupper($token_type)]);
493
494 // Pad backreference numbers from tokens
495 if (preg_match_all('/(?<!\\\\)\$([0-9]+)/', $replace, $repad))
496 {
497 $repad = $pad + sizeof(array_unique($repad[0]));
498 $replace = preg_replace_callback('/(?<!\\\\)\$([0-9]+)/', function ($match) use ($pad) {
499 return '${' . ($match[1] + $pad) . '}';
500 }, $replace);
501 $pad = $repad;
502 }
503
504 // Obtain pattern modifiers to use and alter the regex accordingly
505 $regex = preg_replace('/!(.*)!([a-z]*)/', '$1', $match);
506 $regex_modifiers = preg_replace('/!(.*)!([a-z]*)/', '$2', $match);
507
508 for ($i = 0, $size = strlen($regex_modifiers); $i < $size; ++$i)
509 {
510 if (strpos($modifiers, $regex_modifiers[$i]) === false)
511 {
512 $modifiers .= $regex_modifiers[$i];
513
514 if ($regex_modifiers[$i] == 'e')
515 {
516 $fp_replace = "'" . str_replace("'", "\\'", $fp_replace) . "'";
517 }
518 }
519
520 if ($regex_modifiers[$i] == 'e')
521 {
522 $replace = "'.$replace.'";
523 }
524 }
525
526 $fp_match = str_replace(preg_quote($token, '!'), $regex, $fp_match);
527 $fp_replace = str_replace($token, $replace, $fp_replace);
528
529 $sp_match = str_replace(preg_quote($token, '!'), $sp_tokens[$token_type], $sp_match);
530
531 // Prepend the board url to local relative links
532 $replace_prepend = ($token_type === 'LOCAL_URL') ? generate_board_url() . '/' : '';
533
534 $sp_replace = str_replace($token, $replace_prepend . '${' . ($n + 1) . '}', $sp_replace);
535 }
536
537 $fp_match = '!' . $fp_match . '!' . $modifiers;
538 $sp_match = '!' . $sp_match . '!s' . (($utf8) ? 'u' : '');
539
540 if (strpos($fp_match, 'e') !== false)
541 {
542 $fp_replace = str_replace("'.'", '', $fp_replace);
543 $fp_replace = str_replace(".''.", '.', $fp_replace);
544 }
545 }
546 else
547 {
548 // No replacement is present, no need for a second-pass pattern replacement
549 // A simple str_replace will suffice
550 $fp_match = '!' . $fp_match . '!' . $modifiers;
551 $sp_match = $fp_replace;
552 $sp_replace = '';
553 }
554
555 // Lowercase tags
556 $bbcode_tag = preg_replace('/.*?\[([a-z0-9_-]+=?).*/i', '$1', $bbcode_match);
557 $bbcode_search = preg_replace('/.*?\[([a-z0-9_-]+)=?.*/i', '$1', $bbcode_match);
558
559 if (!preg_match('/^[a-zA-Z0-9_-]+=?$/', $bbcode_tag))
560 {
561 global $user;
562 trigger_error($user->lang['BBCODE_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
563 }
564
565 $fp_match = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
566 return strtolower($match[0]);
567 }, $fp_match);
568 $fp_replace = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
569 return strtolower($match[0]);
570 }, $fp_replace);
571 $sp_match = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
572 return strtolower($match[0]);
573 }, $sp_match);
574 $sp_replace = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
575 return strtolower($match[0]);
576 }, $sp_replace);
577
578 return array(
579 'bbcode_tag' => $bbcode_tag,
580 'first_pass_match' => $fp_match,
581 'first_pass_replace' => $fp_replace,
582 'second_pass_match' => $sp_match,
583 'second_pass_replace' => $sp_replace
584 );
585 }
586 }
587