mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge branch '3.3.x'
This commit is contained in:
commit
e83ae55d2d
2 changed files with 34 additions and 35 deletions
|
@ -48,19 +48,18 @@ class profilefield_youtube_update extends \phpbb\db\migration\migration
|
||||||
$profile_fields = $this->table_prefix . 'profile_fields';
|
$profile_fields = $this->table_prefix . 'profile_fields';
|
||||||
$profile_fields_data = $this->table_prefix . 'profile_fields_data';
|
$profile_fields_data = $this->table_prefix . 'profile_fields_data';
|
||||||
|
|
||||||
$field_validation = $this->db->sql_escape(self::$youtube_url_matcher);
|
$field_data = [
|
||||||
|
'field_length' => 40,
|
||||||
|
'field_minlen' => strlen('https://youtube.com/c/') + 1,
|
||||||
|
'field_maxlen' => 255,
|
||||||
|
'field_validation' => self::$youtube_url_matcher,
|
||||||
|
'field_contact_url' => '%s'
|
||||||
|
];
|
||||||
|
|
||||||
$min_length = strlen('https://youtube.com/c/') + 1;
|
$sql = 'UPDATE ' . $profile_fields . '
|
||||||
|
SET ' . $this->db->sql_build_array('UPDATE', $field_data) . "
|
||||||
$this->db->sql_query(
|
WHERE field_name = 'phpbb_youtube'";
|
||||||
"UPDATE $profile_fields SET
|
$this->db->sql_query($sql);
|
||||||
field_length = '40',
|
|
||||||
field_minlen = '$min_length',
|
|
||||||
field_maxlen = '255',
|
|
||||||
field_validation = '$field_validation',
|
|
||||||
field_contact_url = '%s'
|
|
||||||
WHERE field_name = 'phpbb_youtube'"
|
|
||||||
);
|
|
||||||
|
|
||||||
$yt_profile_field = 'pf_phpbb_youtube';
|
$yt_profile_field = 'pf_phpbb_youtube';
|
||||||
$prepend_legacy_youtube_url = $this->db->sql_concatenate(
|
$prepend_legacy_youtube_url = $this->db->sql_concatenate(
|
||||||
|
|
|
@ -70,18 +70,19 @@ class profilefields_update extends \phpbb\db\migration\migration
|
||||||
$profile_fields_data = $this->table_prefix . 'profile_fields_data';
|
$profile_fields_data = $this->table_prefix . 'profile_fields_data';
|
||||||
$end_time = time() + 5; // allow up to 5 seconds for migration to run
|
$end_time = time() + 5; // allow up to 5 seconds for migration to run
|
||||||
|
|
||||||
$field_validation = $this->db->sql_escape($this->youtube_url_matcher);
|
$field_data = [
|
||||||
|
'field_length' => 20,
|
||||||
|
'field_minlen' => 3,
|
||||||
|
'field_maxlen' => 60,
|
||||||
|
'field_validation' => $this->youtube_url_matcher,
|
||||||
|
'field_contact_url' => 'https://youtube.com/%s',
|
||||||
|
'field_contact_desc' => 'VIEW_YOUTUBE_PROFILE',
|
||||||
|
];
|
||||||
|
|
||||||
$this->db->sql_query(
|
$sql = 'UPDATE ' . $profile_fields . '
|
||||||
"UPDATE $profile_fields
|
SET ' . $this->db->sql_build_array('UPDATE', $field_data) . "
|
||||||
SET field_length = '20',
|
WHERE field_name = 'phpbb_youtube'";
|
||||||
field_minlen = '3',
|
$this->db->sql_query($sql);
|
||||||
field_maxlen = '60',
|
|
||||||
field_validation = '$field_validation',
|
|
||||||
field_contact_url = 'https://youtube.com/%s'
|
|
||||||
field_contact_desc = 'VIEW_YOUTUBE_PROFILE'
|
|
||||||
WHERE field_name = 'phpbb_youtube'"
|
|
||||||
);
|
|
||||||
|
|
||||||
$yt_profile_field = 'pf_phpbb_youtube';
|
$yt_profile_field = 'pf_phpbb_youtube';
|
||||||
$has_youtube_url = $this->db->sql_like_expression($this->db->get_any_char() . 'youtube.com/' . $this->db->get_any_char());
|
$has_youtube_url = $this->db->sql_like_expression($this->db->get_any_char() . 'youtube.com/' . $this->db->get_any_char());
|
||||||
|
@ -138,19 +139,18 @@ class profilefields_update extends \phpbb\db\migration\migration
|
||||||
$profile_fields = $this->table_prefix . 'profile_fields';
|
$profile_fields = $this->table_prefix . 'profile_fields';
|
||||||
$profile_fields_data = $this->table_prefix . 'profile_fields_data';
|
$profile_fields_data = $this->table_prefix . 'profile_fields_data';
|
||||||
|
|
||||||
$old_field_validation = $this->db->sql_escape(profilefield_youtube_update::$youtube_url_matcher);
|
$field_data = [
|
||||||
|
'field_length' => 40,
|
||||||
|
'field_minlen' => strlen('https://youtube.com/c/') + 1,
|
||||||
|
'field_maxlen' => 255,
|
||||||
|
'field_validation' => profilefield_youtube_update::$youtube_url_matcher,
|
||||||
|
'field_contact_url' => '%s'
|
||||||
|
];
|
||||||
|
|
||||||
$min_length = strlen('https://youtube.com/c/') + 1;
|
$sql = 'UPDATE ' . $profile_fields . '
|
||||||
|
SET ' . $this->db->sql_build_array('UPDATE', $field_data) . "
|
||||||
$this->db->sql_query(
|
WHERE field_name = 'phpbb_youtube'";
|
||||||
"UPDATE $profile_fields SET
|
$this->db->sql_query($sql);
|
||||||
field_length = '40',
|
|
||||||
field_minlen = '$min_length',
|
|
||||||
field_maxlen = '255',
|
|
||||||
field_validation = '$old_field_validation',
|
|
||||||
field_contact_url = '%s'
|
|
||||||
WHERE field_name = 'phpbb_youtube'"
|
|
||||||
);
|
|
||||||
|
|
||||||
$yt_profile_field = 'pf_phpbb_youtube';
|
$yt_profile_field = 'pf_phpbb_youtube';
|
||||||
$prepend_legacy_youtube_url = $this->db->sql_concatenate(
|
$prepend_legacy_youtube_url = $this->db->sql_concatenate(
|
||||||
|
|
Loading…
Add table
Reference in a new issue