s from environment variables * * @since 1.8.2 * @return bool true if YOURLS_USER and YOURLS_PASSWORD are defined as environment variables */ function yourls_is_user_from_env() { return yourls_apply_filter('is_user_from_env', getenv('YOURLS_USER') && getenv('YOURLS_PASSWORD')); } /** * Check if we should hash passwords in the config file * * By default, passwords are hashed. They are not if * - there is no password in clear text in the config file (ie everything is already hashed) * - the user defined constant YOURLS_NO_HASH_PASSWORD is true, see https://github.com/YOURLS/YOURLS/wiki/Username-Passwords#but-i-dont-want-to-encrypt-my-password- * - YOURLS_USER and YOURLS_PASSWORD are provided by the environment, not the config file * * @since 1.8.2 * @return bool */ function yourls_maybe_hash_passwords() { $hash = true; if ( !yourls_has_cleartext_passwords() OR (yourls_skip_password_hashing()) OR (yourls_is_user_from_env()) ) { $hash = false; } return yourls_apply_filter('maybe_hash_password', $hash ); } /** * Check if user setting for skipping password hashing is set * * @since 1.8.2 * @return bool */ function yourls_skip_password_hashing() { return yourls_apply_filter('skip_password_hashing', defined('YOURLS_NO_HASH_PASSWORD') && YOURLS_NO_HASH_PASSWORD); }