Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

local_url_bbcode.php

Zuletzt modifiziert: 09.10.2024, 12:57 - Dateigröße: 1.81 KiB


 01  <?php
 02  /**
 03  *
 04  * This file is part of the phpBB Forum Software package.
 05  *
 06  * @copyright (c) phpBB Limited <https://www.phpbb.com>
 07  * @license GNU General Public License, version 2 (GPL-2.0)
 08  *
 09  * For full copyright and license information, please see
 10  * the docs/CREDITS.txt file.
 11  *
 12  */
 13   
 14  namespace phpbb\db\migration\data\v30x;
 15   
 16  class local_url_bbcode extends \phpbb\db\migration\migration
 17  {
 18      static public function depends_on()
 19      {
 20          return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc1');
 21      }
 22   
 23      public function update_data()
 24      {
 25          return array(
 26              array('custom', array(array($this, 'update_local_url_bbcode'))),
 27          );
 28      }
 29   
 30      /**
 31      * Update BBCodes that currently use the LOCAL_URL tag
 32      *
 33      * To fix http://tracker.phpbb.com/browse/PHPBB3-8319 we changed
 34      * the second_pass_replace value, so that needs updating for existing ones
 35      */
 36      public function update_local_url_bbcode()
 37      {
 38          $sql = 'SELECT *
 39              FROM ' . BBCODES_TABLE . '
 40              WHERE bbcode_match ' . $this->db->sql_like_expression($this->db->get_any_char() . 'LOCAL_URL' . $this->db->get_any_char());
 41          $result = $this->db->sql_query($sql);
 42   
 43          while ($row = $this->db->sql_fetchrow($result))
 44          {
 45              if (!class_exists('acp_bbcodes'))
 46              {
 47                  if (function_exists('phpbb_require_updated'))
 48                  {
 49                      phpbb_require_updated('includes/acp/acp_bbcodes.' . $this->php_ext);
 50                  }
 51                  else
 52                  {
 53                      require($this->phpbb_root_path . 'includes/acp/acp_bbcodes.' . $this->php_ext);
 54                  }
 55              }
 56   
 57              $bbcode_match = $row['bbcode_match'];
 58              $bbcode_tpl = $row['bbcode_tpl'];
 59   
 60              $acp_bbcodes = new \acp_bbcodes();
 61              $sql_ary = $acp_bbcodes->build_regexp($bbcode_match, $bbcode_tpl);
 62   
 63              $sql = 'UPDATE ' . BBCODES_TABLE . '
 64                  SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
 65                  WHERE bbcode_id = ' . (int) $row['bbcode_id'];
 66              $this->sql_query($sql);
 67          }
 68          $this->db->sql_freeresult($result);
 69      }
 70  }
 71