sirius-press/patches/0001-wp-admin-install-php.patch
Silent Mode 645afcddd2 feat(sirius-press): take WordPress 7.1.2, and fix what that exposed
The first real upstream release since the subtree landed, and the point of
the whole arrangement. It merged cleanly: 7.1.2 changes about.php,
template.php and version.php, none of which this fork touches, so the patched
installer came through byte-identical and there was nothing to resolve.

Getting there needed two fixes to the tool, both of which only a real release
could have found — the earlier same-version run was a no-op that exercised
none of this.

**The prefix was an absolute path.** `${here#"$repo"/}` assumes the two
strings share a spelling, and on Windows they do not: --show-toplevel answers
"D:/Dev/…" while $PWD is "/d/Dev/…", so the subtraction left the path
untouched and `git subtree merge --prefix` was handed something absolute. The
same bug was fixed in refresh-patches.sh a few commits ago; this is the other
copy of it. Both now ask git via `rev-parse --show-prefix`.

**git-subtree refuses to run in a dirty repository** — any modification
anywhere, not just under the subtree. In a monorepo shared with other work
that is the normal state, so the tool was unusable exactly where it lives.
The merge now happens in a scratch worktree, which is clean by construction,
and comes back as one ordinary merge commit that touches only wordpress/ and
so does not care what else is modified.

Also: a failed run no longer refuses to retry. The import onto the upstream
branch is idempotent now, and the failure message distinguishes "upstream and
the fork changed the same lines" from "the merge could not start", instead of
blaming a conflict for both.
2026-09-22 20:18:45 +02:00

82 lines
4.6 KiB
Diff

Subject: [PATCH] wp-admin/install.php
The fork's change to this file, regenerated by tools/refresh-patches.sh.
It is a record, not the mechanism: core is vendored under wordpress/ and
this diff is what distinguishes it from pristine upstream.
Applies to: WordPress 7.1.2
--- a/wp-admin/install.php
+++ b/wp-admin/install.php
@@ -101,6 +101,8 @@ function display_setup_form( $error = null ) {
$weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
$user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
$admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
+ // Sirius Press: the identity field on this form is a wallet address.
+ $admin_wallet = isset( $_POST['admin_wallet'] ) ? trim( wp_unslash( $_POST['admin_wallet'] ) ) : '';
if ( ! is_null( $error ) ) {
?>
@@ -175,9 +177,9 @@ function display_setup_form( $error = null ) {
</tr>
<?php endif; ?>
<tr>
- <th scope="row"><label for="admin_email"><?php _e( 'Your Email' ); ?></label></th>
- <td><input name="admin_email" type="email" id="admin_email" size="25" aria-describedby="admin-email-desc" value="<?php echo esc_attr( $admin_email ); ?>" />
- <p id="admin-email-desc"><?php _e( 'Double-check your email address before continuing.' ); ?></p></td>
+ <th scope="row"><label for="admin_wallet"><?php _e( 'Your wallet address' ); ?></label></th>
+ <td><input name="admin_wallet" type="text" id="admin_wallet" size="25" class="code" aria-describedby="admin-wallet-desc" value="<?php echo esc_attr( $admin_wallet ); ?>" autocapitalize="off" autocomplete="off" spellcheck="false" />
+ <p id="admin-wallet-desc"><?php _e( 'Sirius Press: your Bitcoin Cash address is your account. Leave this blank to attach one later from your profile &mdash; until then the password above is the only way in.' ); ?></p></td>
</tr>
<?php $blog_privacy_selector_title = has_action( 'blog_privacy_selector' ) ? __( 'Site visibility' ) : __( 'Search engine visibility' ); ?>
<tr>
@@ -411,10 +413,20 @@ switch ( $step ) {
$user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
$admin_password = isset( $_POST['admin_password'] ) ? wp_unslash( $_POST['admin_password'] ) : '';
$admin_password_check = isset( $_POST['admin_password2'] ) ? wp_unslash( $_POST['admin_password2'] ) : '';
- $admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
+ $admin_wallet = isset( $_POST['admin_wallet'] ) ? trim( wp_unslash( $_POST['admin_wallet'] ) ) : '';
$public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 1;
- // Check email address.
+ /*
+ * Sirius Press: there is no email step. The account identity is a
+ * CashAddress, and it is optional here because the installer has nothing
+ * to verify a signature against yet — the site does not exist. An address
+ * typed now is attached below; an administrator who leaves it blank
+ * attaches one from their profile afterwards, where they can prove it.
+ */
+ $admin_wallet = sirius_press_install_address( $admin_wallet );
+ $admin_email = sirius_press_install_stub_email( $admin_wallet );
+
+ // Check the username and password.
$error = false;
if ( empty( $user_name ) ) {
// TODO: Poka-yoke.
@@ -427,19 +439,20 @@ switch ( $step ) {
// TODO: Poka-yoke.
display_setup_form( __( 'Your passwords do not match. Please try again.' ) );
$error = true;
- } elseif ( empty( $admin_email ) ) {
- // TODO: Poka-yoke.
- display_setup_form( __( 'You must provide an email address.' ) );
- $error = true;
- } elseif ( ! is_email( $admin_email ) ) {
- // TODO: Poka-yoke.
- display_setup_form( __( 'Sorry, that is not a valid email address. Email addresses look like <code>username@example.com</code>.' ) );
+ } elseif ( false === $admin_wallet ) {
+ display_setup_form( __( 'Sorry, that is not a valid Bitcoin Cash address. Leave the field blank if you would rather attach a wallet after installing.' ) );
$error = true;
}
if ( false === $error ) {
$wpdb->show_errors();
$result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language );
+
+ // Sirius Press: record the administrator's wallet so they can sign in
+ // with it immediately.
+ if ( '' !== $admin_wallet && ! empty( $result['user_id'] ) ) {
+ update_user_meta( (int) $result['user_id'], 'sirius_wallet_address', $admin_wallet );
+ }
?>
<h1><?php _e( 'Success!' ); ?></h1>