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

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

profilefield_remove_underscore_from_alpha.php

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


 01  <?php
 02   
 03  /**
 04   *
 05   * This file is part of the phpBB Forum Software package.
 06   *
 07   * @copyright (c) phpBB Limited <https://www.phpbb.com>
 08   * @license GNU General Public License, version 2 (GPL-2.0)
 09   *
 10   * For full copyright and license information, please see
 11   * the docs/CREDITS.txt file.
 12   *
 13   */
 14   
 15  namespace phpbb\db\migration\data\v31x;
 16   
 17  class profilefield_remove_underscore_from_alpha extends \phpbb\db\migration\migration
 18  {
 19      static public function depends_on()
 20      {
 21          return array('\phpbb\db\migration\data\v31x\v311');
 22      }
 23   
 24      public function update_data()
 25      {
 26          return array(
 27              array('custom', array(array($this, 'remove_underscore_from_alpha_validations'))),
 28          );
 29      }
 30   
 31      public function remove_underscore_from_alpha_validations()
 32      {
 33          $this->update_validation_rule('[\w]+', '[a-zA-Z0-9]+');
 34          $this->update_validation_rule('[\w_]+', '[\w]+');
 35          $this->update_validation_rule('[\w.]+', '[a-zA-Z0-9.]+');
 36          $this->update_validation_rule('[\w\x20_+\-\[\]]+', '[\w\x20+\-\[\]]+');
 37          $this->update_validation_rule('[a-zA-Z][\w\.,\-_]+', '[a-zA-Z][\w\.,\-]+');
 38      }
 39   
 40      public function update_validation_rule($old_validation, $new_validation)
 41      {
 42          $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . "
 43              SET field_validation = '" . $this->db->sql_escape($new_validation) . "'
 44              WHERE field_validation = '" . $this->db->sql_escape($old_validation) . "'";
 45          $this->db->sql_query($sql);
 46      }
 47  }
 48