[ Index ] |
PHP Cross Reference of phpBB-3.3.14-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * 4 * This file is part of the phpBB Forum Software package. 5 * 6 * @copyright (c) phpBB Limited <https://www.phpbb.com> 7 * @license GNU General Public License, version 2 (GPL-2.0) 8 * 9 * For full copyright and license information, please see 10 * the docs/CREDITS.txt file. 11 * 12 */ 13 14 namespace phpbb\db\migration\data\v31x; 15 16 class update_custom_bbcodes_with_idn extends \phpbb\db\migration\migration 17 { 18 static public function depends_on() 19 { 20 return array( 21 '\phpbb\db\migration\data\v31x\v312', 22 ); 23 } 24 25 public function update_data() 26 { 27 return array( 28 array('custom', array(array($this, 'update_bbcodes_table'))), 29 ); 30 } 31 32 public function update_bbcodes_table() 33 { 34 if (!class_exists('acp_bbcodes')) 35 { 36 include($this->phpbb_root_path . 'includes/acp/acp_bbcodes.' . $this->php_ext); 37 } 38 39 $bbcodes = new \acp_bbcodes(); 40 41 $sql = 'SELECT bbcode_id, bbcode_match, bbcode_tpl 42 FROM ' . BBCODES_TABLE; 43 $result = $this->sql_query($sql); 44 45 $sql_ary = array(); 46 while ($row = $this->db->sql_fetchrow($result)) 47 { 48 if (preg_match('/(URL|LOCAL_URL|RELATIVE_URL)/', $row['bbcode_match'])) 49 { 50 $data = $bbcodes->build_regexp($row['bbcode_match'], $row['bbcode_tpl']); 51 $sql_ary[$row['bbcode_id']] = array( 52 'first_pass_match' => $data['first_pass_match'], 53 'first_pass_replace' => $data['first_pass_replace'], 54 'second_pass_match' => $data['second_pass_match'], 55 'second_pass_replace' => $data['second_pass_replace'] 56 ); 57 } 58 } 59 $this->db->sql_freeresult($result); 60 61 foreach ($sql_ary as $bbcode_id => $bbcode_data) 62 { 63 $sql = 'UPDATE ' . BBCODES_TABLE . ' 64 SET ' . $this->db->sql_build_array('UPDATE', $bbcode_data) . ' 65 WHERE bbcode_id = ' . (int) $bbcode_id; 66 $this->sql_query($sql); 67 } 68 } 69 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Mon Nov 25 19:05:08 2024 | Cross-referenced by PHPXref 0.7.1 |