Skip to content

Commit a23d53f

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/dev'
2 parents c24bedd + ca8d24e commit a23d53f

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

wpstarter/src/Setup/Salter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function keys()
4040
if (! is_array($this->result)) {
4141
$this->result = array();
4242
foreach (self::$keys as $key) {
43-
$this->result[$key] = $this->buildKey(54);
43+
$this->result[$key] = $this->buildKey(64);
4444
}
4545
}
4646

@@ -55,10 +55,10 @@ public function keys()
5555
*/
5656
private function buildKey($length)
5757
{
58-
$chars = '=,.;:/?|abcdefghijklmnopqrstuvwxyz!@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ-_[]{}<>~`+0123456789';
58+
$chars = ' =,.;:/?!|@#$%^&*()-_[]{}<>~`+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
5959
$key = '';
6060
for ($i = 0; $i < $length; $i++) {
61-
$rand = mt_rand(0, 90);
61+
$rand = mt_rand(0, 91);
6262
$key .= $chars[$rand];
6363
}
6464

wpstarter/templates/wp-config.example

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?php
22
/**
3-
* This file is generated by WP Starter Package, and contains base configurations of the WordPress.
3+
* This file is generated by WP Starter package, and contains base configuration of the WordPress.
44
*
5-
* All the configuration constants used by WordPress are set via .env file.
5+
* All the configuration constants used by WordPress are set via environment variables.
66
* Default settings are provided in this file for most common settings, however database settings
77
* are required, you can get them from your web host.
8+
*
89
* A sample .env file (.env.example) should be placed in the root of your project, rename it to .env
910
* and edit it according to your needs.
1011
*/
@@ -17,13 +18,13 @@ require_once realpath({{{VENDOR_PATH}}}.'/autoload.php');
1718
/**
1819
* Configuration constants.
1920
*
20-
* Use .env file to set WordPress constants.
21+
* Use environment variables to set WordPress constants.
2122
* Mandatory settings:
2223
* - DB_NAME
2324
* - DB_USER
2425
* - DB_PASSWORD
2526
*
26-
* @var array $env All the variables stored in .env file
27+
* @var array $env All the variables stored in environment variables
2728
*/
2829
$env = WCM\WPStarter\Helpers::settings({{{ENV_REL_PATH}}}, '{{{ENV_FILE_NAME}}}');
2930
array_walk($env, function ($value, $name) {
@@ -54,24 +55,21 @@ if (! isset($table_prefix) || empty($table_prefix)) {
5455
}
5556

5657
/**
57-
* Set unique authentication keys if not already set via .env file.
58-
* If available, environment name is mixed to keys so they become unique per environment.
58+
* Set unique authentication keys if not already set via environment variables.
5959
*/
60-
$environment = getenv('WORDPRESS_ENV');
61-
$pre = $environment ? substr($environment, 0, 5) : substr('{{{AUTH_KEY}}}', 0, 5);
62-
$post = $environment ? substr($environment, -5, 5) : substr('{{{SECURE_AUTH_KEY}}}', 0, 5);
63-
defined('AUTH_KEY') or define('AUTH_KEY', $pre.'{{{AUTH_KEY}}}'.$post);
64-
defined('SECURE_AUTH_KEY') or define('SECURE_AUTH_KEY', $pre.'{{{SECURE_AUTH_KEY}}}'.$post);
65-
defined('LOGGED_IN_KEY') or define('LOGGED_IN_KEY', $pre.'{{{LOGGED_IN_KEY}}}'.$post);
66-
defined('NONCE_KEY') or define('NONCE_KEY', $pre.'{{{NONCE_KEY}}}'.$post);
67-
defined('AUTH_SALT') or define('AUTH_SALT', $pre.'{{{AUTH_SALT}}}'.$post);
68-
defined('SECURE_AUTH_SALT') or define('SECURE_AUTH_SALT', $pre.'{{{SECURE_AUTH_SALT}}}'.$post);
69-
defined('LOGGED_IN_SALT') or define('LOGGED_IN_SALT', $pre.'{{{LOGGED_IN_SALT}}}'.$post);
70-
defined('NONCE_SALT') or define('NONCE_SALT', $pre.'{{{NONCE_SALT}}}'.$post);
60+
defined('AUTH_KEY') or define('AUTH_KEY', '{{{AUTH_KEY}}}');
61+
defined('SECURE_AUTH_KEY') or define('SECURE_AUTH_KEY', '{{{SECURE_AUTH_KEY}}}');
62+
defined('LOGGED_IN_KEY') or define('LOGGED_IN_KEY', '{{{LOGGED_IN_KEY}}}');
63+
defined('NONCE_KEY') or define('NONCE_KEY', '{{{NONCE_KEY}}}');
64+
defined('AUTH_SALT') or define('AUTH_SALT', '{{{AUTH_SALT}}}');
65+
defined('SECURE_AUTH_SALT') or define('SECURE_AUTH_SALT', '{{{SECURE_AUTH_SALT}}}');
66+
defined('LOGGED_IN_SALT') or define('LOGGED_IN_SALT', '{{{LOGGED_IN_SALT}}}');
67+
defined('NONCE_SALT') or define('NONCE_SALT', '{{{NONCE_SALT}}}');
7168

7269
/**
7370
* Environment-aware settings. Be creative, but avoid to set sensitive settings here.
7471
*/
72+
$environment = getenv('WORDPRESS_ENV');
7573
switch ($environment) {
7674

7775
case 'development':
@@ -112,7 +110,7 @@ if (
112110
}
113111

114112
/**
115-
* Set WordPress paths and urls if not set via .env file.
113+
* Set WordPress paths and urls if not set via environment variables.
116114
*/
117115
if (! defined('WP_HOME')) {
118116
$server = filter_input_array(INPUT_SERVER, array(
@@ -133,7 +131,7 @@ defined('WP_CONTENT_URL') or define('WP_CONTENT_URL', rtrim(WP_HOME, '/').'/{{{W
133131
/**
134132
* Clean up.
135133
*/
136-
unset($env, $environment, $pre, $post, $server, $secure, $scheme, $name);
134+
unset($env, $environment, $server, $secure, $scheme, $name);
137135

138136
/**
139137
* Allows to load MU plugins in subfolders.

0 commit comments

Comments
 (0)