diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-09 14:20:50 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-09 14:20:50 -0800 |
commit | 6ea7e1c06e70b4adb459555336402a284fbe3fda (patch) | |
tree | 3e3509b54b5954ddffd6636fa072bec082cf76b1 /install.php | |
parent | 8bf1b54abd860fbfa8c036aac0c3d3a5faf2f489 (diff) | |
parent | 60e6172bc9e52f1e6b4941811e2d6fd6050c1c6b (diff) |
Merge branch 'testing' into 0.9.x
Diffstat (limited to 'install.php')
-rw-r--r-- | install.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/install.php b/install.php index fbedbaf01..9a7e27fa2 100644 --- a/install.php +++ b/install.php @@ -589,7 +589,7 @@ function handlePost() $sitename = $_POST['sitename']; $fancy = !empty($_POST['fancy']); - $adminNick = $_POST['admin_nickname']; + $adminNick = strtolower($_POST['admin_nickname']); $adminPass = $_POST['admin_password']; $adminPass2 = $_POST['admin_password2']; $adminEmail = $_POST['admin_email']; @@ -630,6 +630,19 @@ STR; updateStatus("No initial StatusNet user nickname specified.", true); $fail = true; } + if ($adminNick && !preg_match('/^[0-9a-z]{1,64}$/', $adminNick)) { + updateStatus('The user nickname "' . htmlspecialchars($adminNick) . + '" is invalid; should be plain letters and numbers no longer than 64 characters.', true); + $fail = true; + } + // @fixme hardcoded list; should use User::allowed_nickname() + // if/when it's safe to have loaded the infrastructure here + $blacklist = array('main', 'admin', 'twitter', 'settings', 'rsd.xml', 'favorited', 'featured', 'favoritedrss', 'featuredrss', 'rss', 'getfile', 'api', 'groups', 'group', 'peopletag', 'tag', 'user', 'message', 'conversation', 'bookmarklet', 'notice', 'attachment', 'search', 'index.php', 'doc', 'opensearch', 'robots.txt', 'xd_receiver.html', 'facebook'); + if (in_array($adminNick, $blacklist)) { + updateStatus('The user nickname "' . htmlspecialchars($adminNick) . + '" is reserved.', true); + $fail = true; + } if (empty($adminPass)) { updateStatus("No initial StatusNet user password specified.", true); |