diff --git a/phpBB/cron.php b/phpBB/cron.php
index 99a8b42955..ea4c4ddef2 100644
--- a/phpBB/cron.php
+++ b/phpBB/cron.php
@@ -30,7 +30,8 @@ header('Content-length: 43');
echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
-flush();
+// test without flush ;)
+// flush();
/**
* Run cron-like action
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index a250aaed47..6d130fefc0 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -222,8 +222,10 @@ p a {
[Fix] Display php information page with the correct direction (Bug #12557)
[Fix] Increased the number of style objects (styles, templates, themes and imagesets) possible from 127 to 65535 for MySQL (Bug #13179)
[Fix] Although theoretically impossible in our code, removed the chance of trying to open a file that does not exist (Bug #13327)
- [Fix] Although theoretically impossible in our code, changed the handling of non-existent language files (Bug #13329, Bug #13331)
+ [Fix] Although theoretically impossible in our code, changed the handling of non-existent language files (Bug #13329, #13331)
[Fix] Removed extra ampersand from ACP link (Bug #13315)
+ [Fix] used cleaned up version of given field identification for pre-filling a new custom profile field (Bug #13319)
+
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 1041acc962..f5ff319ece 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -349,12 +349,12 @@ class acp_profile
}
$field_row = array_merge($default_values[$field_type], array(
- 'field_ident' => request_var('field_ident', ''),
+ 'field_ident' => utf8_clean_string(request_var('field_ident', '', true)),
'field_required' => 0,
'field_hide' => 0,
'field_no_view' => 0,
'field_show_on_reg' => 0,
- 'lang_name' => '',
+ 'lang_name' => request_var('field_ident', '', true),
'lang_explain' => '',
'lang_default_value'=> '')
);
@@ -381,7 +381,7 @@ class acp_profile
$exclude[1][] = 'lang_options';
}
- $cp->vars['field_ident'] = request_var('field_ident', $field_row['field_ident']);
+ $cp->vars['field_ident'] = ($action == 'create' && $step == 1) ? utf8_clean_string(request_var('field_ident', $field_row['field_ident'], true)) : request_var('field_ident', $field_row['field_ident']);
$cp->vars['lang_name'] = request_var('lang_name', $field_row['lang_name'], true);
$cp->vars['lang_explain'] = request_var('lang_explain', $field_row['lang_explain'], true);
$cp->vars['lang_default_value'] = request_var('lang_default_value', $field_row['lang_default_value'], true);
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 50e84fca84..4feb17cac5 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -368,40 +368,47 @@ function user_delete($mode, $user_id, $post_username = false)
$post_username = $user->lang['GUEST'];
}
- $sql = 'UPDATE ' . FORUMS_TABLE . '
- SET forum_last_poster_id = ' . ANONYMOUS . ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "', forum_last_poster_colour = ''
- WHERE forum_last_poster_id = $user_id";
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . POSTS_TABLE . '
- SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($post_username) . "'
- WHERE poster_id = $user_id";
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . POSTS_TABLE . '
- SET post_edit_user = ' . ANONYMOUS . "
- WHERE post_edit_user = $user_id";
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = ''
- WHERE topic_poster = $user_id";
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = ''
- WHERE topic_last_poster_id = $user_id";
- $db->sql_query($sql);
-
- // Since we change every post by this author, we need to count this amount towards the anonymous user
-
- // Update the post count for the anonymous user
- if ($user_row['user_posts'])
+ // If the user is inactive and newly registered we assume no posts from this user being there...
+ if ($user_row['user_type'] == USER_INACTIVE && $user_row['user_inactive_reason'] == INACTIVE_REGISTER && !$user_row['user_posts'])
{
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_posts = user_posts + ' . $user_row['user_posts'] . '
- WHERE user_id = ' . ANONYMOUS;
+ }
+ else
+ {
+ $sql = 'UPDATE ' . FORUMS_TABLE . '
+ SET forum_last_poster_id = ' . ANONYMOUS . ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "', forum_last_poster_colour = ''
+ WHERE forum_last_poster_id = $user_id";
$db->sql_query($sql);
+
+ $sql = 'UPDATE ' . POSTS_TABLE . '
+ SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($post_username) . "'
+ WHERE poster_id = $user_id";
+ $db->sql_query($sql);
+
+ $sql = 'UPDATE ' . POSTS_TABLE . '
+ SET post_edit_user = ' . ANONYMOUS . "
+ WHERE post_edit_user = $user_id";
+ $db->sql_query($sql);
+
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = ''
+ WHERE topic_poster = $user_id";
+ $db->sql_query($sql);
+
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = ''
+ WHERE topic_last_poster_id = $user_id";
+ $db->sql_query($sql);
+
+ // Since we change every post by this author, we need to count this amount towards the anonymous user
+
+ // Update the post count for the anonymous user
+ if ($user_row['user_posts'])
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_posts = user_posts + ' . $user_row['user_posts'] . '
+ WHERE user_id = ' . ANONYMOUS;
+ $db->sql_query($sql);
+ }
}
break;
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index e6eb9c2bbc..08e937f4cc 100755
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -724,7 +724,7 @@ class module
{
$path = $phpbb_root_path . 'language/' . $file;
- if (is_file($path) || is_link($path) || $file == '.' || $file == '..' || $file == 'CVS')
+ if ($file == '.' || $file == '..' || is_link($path) || is_file($path) || $file == 'CVS')
{
continue;
}