File wordpress-sysconfdir.patch of Package wordpress

diff -Nur wordpress-orig/wp-admin/setup-config.php wordpress/wp-admin/setup-config.php
--- wordpress-orig/wp-admin/setup-config.php	2023-02-23 11:38:21.000000000 +0100
+++ wordpress/wp-admin/setup-config.php	2023-03-31 18:10:50.903240282 +0200
@@ -164,6 +164,7 @@
 		?>
 </h1>
 <p><?php _e( 'Welcome to WordPress. Before getting started, you will need to know the following items.' ); ?></p>
+<p><?php _e( 'You should already have created this database, and granted access for user you're going to define here.' ); ?></p>
 <ol>
 	<li><?php _e( 'Database name' ); ?></li>
 	<li><?php _e( 'Database username' ); ?></li>
@@ -401,7 +402,7 @@
 		}
 		unset( $line );
 
-		if ( ! is_writable( ABSPATH ) ) :
+		if ( ! is_writable(dirname($WP_Config)) ) :
 			setup_config_display_header();
 			?>
 <p>
@@ -453,7 +454,7 @@
 			}
 
 			$error_message = '';
-			$handle        = fopen( $path_to_wp_config, 'w' );
+			$handle = fopen($WP_Config, 'w');
 			/*
 			 * Why check for the absence of false instead of checking for resource with is_resource()?
 			 * To future-proof the check for when fopen returns object instead of resource, i.e. a known
@@ -482,7 +483,7 @@
 				}
 			}
 
-			chmod( $path_to_wp_config, 0666 );
+			chmod($WP_Config, 0640);
 			setup_config_display_header();
 
 			if ( false !== $handle ) :
diff -Nur wordpress-orig/wp-config-sample.php wordpress/wp-config-sample.php
--- wordpress-orig/wp-config-sample.php	2023-02-23 11:38:21.000000000 +0100
+++ wordpress/wp-config-sample.php	2023-03-31 18:12:21.391723414 +0200
@@ -94,3 +94,15 @@
 
 /** Sets up WordPress vars and included files. */
 require_once ABSPATH . 'wp-settings.php';
+
+/** Sets up 'direct' method for wordpress, auto update without FTP
+ * FS_METHOD forces the filesystem method. It should only be "direct", "ssh2", "ftpext", or "ftpsockets".
+ * Generally, You should only change this if you are experiencing update problems, If you change it, and it doesnt help change it back/remove it,
+ * Under most circumstances, setting it to 'ftpsockets' will work if the automatically chosen method does not.
+ *
+ *  (Primary Preference) "direct" forces it to use Direct File I/O requests from within PHP, this is fraught with opening up security issues on poorly configured hosts, This is chosen automatically when appropriate.
+ *  (Secondary Preference) "ssh2" is to force the usage of the SSH PHP Extension if installed
+ *  (3rd Preference) "ftpext" is to force the usage of the FTP PHP Extension for FTP Access, and finally
+ *  (4th Preference) "ftpsockets" utilises the PHP Sockets Class for FTP Access. 
+ */
+define('FS_METHOD','direct');
diff -Nur wordpress-orig/wp-load.php wordpress/wp-load.php
--- wordpress-orig/wp-load.php	2023-02-23 11:38:21.000000000 +0100
+++ wordpress/wp-load.php	2023-03-31 18:21:24.242517828 +0200
@@ -21,6 +21,14 @@
 	define( 'ABSPATH', __DIR__ . '/' );
 }
 
+/**
+ * @global WP_Config $_SESSION['WP_Config']
+ * force reading of config file, because we removed sensitive values
+ * in the previous iteration
+ */
+$_SESSION['WP_Config'] = ('@WP_CONFIG_ROOT@/wp-config.php');
+$WP_Config = $_SESSION['WP_Config'];
+
 /*
  * The error_reporting() function can be disabled in php.ini. On systems where that is the case,
  * it's best to add a dummy function to the wp-config.php file, but as this call to the function
@@ -44,15 +52,10 @@
  *
  * If neither set of conditions is true, initiate loading the setup process.
  */
-if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
+if ( file_exists($WP_Config) ) {
 
 	/** The config file resides in ABSPATH */
-	require_once ABSPATH . 'wp-config.php';
-
-} elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {
-
-	/** The config file resides one level above ABSPATH but is not part of another installation */
-	require_once dirname( ABSPATH ) . '/wp-config.php';
+    require_once($WP_Config);
 
 } else {
 
openSUSE Build Service is sponsored by