Skip to content
Snippets Groups Projects
Commit 9f25954a authored by lucha's avatar lucha
Browse files

consolidate three similar patches to update.php into a single one

parent 03830d1d
No related branches found
No related tags found
No related merge requests found
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
"johnpbloch/wordpress-core": { "johnpbloch/wordpress-core": {
"Patch definition of WP_CONTENT_URL to include SSL when it might not ": "patches/core/0052-fix-ssl-wp-content-url.patch", "Patch definition of WP_CONTENT_URL to include SSL when it might not ": "patches/core/0052-fix-ssl-wp-content-url.patch",
"Disable WP 1.2 upgrade": "patches/core/wp-upgrade-110.patch", "Disable WP 1.2 upgrade": "patches/core/wp-upgrade-110.patch",
"Do not leak how many users/blogs there are to api.wordpress.org" : "patches/core/0101-Do-not-leak-how-many-users-blogs-there-are-to-api.wo.patch", "Anonymize requests to api.wordpress.org for updates": "patches/core/anonymize-update.php.patch",
"Anonymize user-agent and don't send some headers when checking for updates": "patches/core/0102-anonymize-user-agent-and-don-t-send-some-headers-whe.patch",
"Do not perform pingbacks and trackbacks when we update via cron": "patches/core/0103-Remove-pingback-trackback.patch", "Do not perform pingbacks and trackbacks when we update via cron": "patches/core/0103-Remove-pingback-trackback.patch",
"Don't leak which blog has been logged into via get_bloginfo()": "patches/core/0110-Don-t-leak-which-blog-has-been-logged-into-via-get_b.patch",
"Do not use fake wordpress version": "patches/core/0153-do-not-use-fake-wordpress-version.patch",
"Stop Wordpress from hardcoding the location of debug.log": "patches/core/0199-patch-stops-wordpress-from-hardcoding-the-location-o.patch", "Stop Wordpress from hardcoding the location of debug.log": "patches/core/0199-patch-stops-wordpress-from-hardcoding-the-location-o.patch",
"Load JS library locally instead than from Googleapis": "patches/core/0155-Removing-reference-to-googleapis-from-wp-includes-up.patch" "Load JS library locally instead than from Googleapis": "patches/core/0155-Removing-reference-to-googleapis-from-wp-includes-up.patch"
}, },
......
From aca9b6de717655b69d3825b36273f6ef29d7abc1 Mon Sep 17 00:00:00 2001
From: root <root@rivolta.investici.org>
Date: Sun, 27 Feb 2011 19:05:01 +0000
Subject: [PATCH 101/229] Do not leak how many users/blogs there are to
api.wordpress.org
---
wp-includes/update.php | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/wp-includes/update.php b/wp-includes/update.php
index 520f7943..79eb1c68 100644
--- a/wp-includes/update.php
+++ b/wp-includes/update.php
@@ -89,15 +89,15 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
}
$query = array(
- 'version' => $wp_version,
- 'php' => $php_version,
- 'locale' => $locale,
- 'mysql' => $mysql_version,
- 'local_package' => isset( $wp_local_package ) ? $wp_local_package : '',
- 'blogs' => $num_blogs,
- 'users' => $user_count,
- 'multisite_enabled' => $multisite_enabled,
- 'initial_db_version' => get_site_option( 'initial_db_version' ),
+ 'version' => $wp_version,
+ 'php' => 'N/A',
+ 'locale' => 'C',
+ 'mysql' => 'N/A',
+ 'local_package' => isset( $wp_local_package ) ? $wp_local_package : '',
+ 'blogs' => 31337,
+ 'users' => 31337,
+ 'multisite_enabled' => 0,
+ 'initial_db_version' => 31337
);
/**
--
2.17.1
From aca0ad8d07974354108d78b03fe0aa42b3fe99d1 Mon Sep 17 00:00:00 2001
From: shammash <shammash@autistici.org>
Date: Fri, 28 Dec 2012 14:57:16 +0000
Subject: [PATCH 153/229] do not use fake wordpress version
Wordpress APIs use the Wordpress version in the user-agent to determine which
plugins are available for an update. Using a fake version breaks this
mechanism.
Signed-off-by: shammash <shammash@autistici.org>
---
wp-includes/update.php | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/wp-includes/update.php b/wp-includes/update.php
index eab29591..bf4d4d8e 100644
--- a/wp-includes/update.php
+++ b/wp-includes/update.php
@@ -144,11 +144,7 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
$options = array(
'timeout' => $doing_cron ? 30 : 3,
'user-agent' => 'WordPress/' . $wp_version . '; http://wordpress.org',
- 'headers' => array(
- 'wp_install' => home_url( '/' ),
- 'wp_blog' => home_url( '/' )
- ),
- 'body' => $post_body,
+ 'body' => $post_body,
);
$response = wp_remote_post( $url, $options );
--
2.17.1
From 1236de9cb3faee91873b38059a7362450f5b82fe Mon Sep 17 00:00:00 2001 Combines old patches to update.php
From: root <root@rivolta.investici.org> * 0101-Do-not-leak-how-many-users-blogs-there-are-to-api.wo.patch
Date: Sun, 27 Feb 2011 19:29:57 +0000 * 0102-anonymize-user-agent-and-don-t-send-some-headers-whe.patch
Subject: [PATCH 102/229] anonymize user-agent and don't send some headers when * 0153-do-not-use-fake-wordpress-version.patch
checking for updates
--- --- wp-includes/update.php 2021-02-21 19:16:27.926182327 -0800
wp-includes/update.php | 14 +++++++------- +++ wp-includes/update.php 2021-02-21 19:10:04.860633838 -0800
1 file changed, 7 insertions(+), 7 deletions(-) @@ -93,15 +93,15 @@
}
diff --git a/wp-includes/update.php b/wp-includes/update.php
index 79eb1c68..eab29591 100644 $query = array(
--- a/wp-includes/update.php - 'version' => $wp_version,
+++ b/wp-includes/update.php - 'php' => $php_version,
@@ -142,11 +142,11 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) { - 'locale' => $locale,
- 'mysql' => $mysql_version,
- 'local_package' => isset( $wp_local_package ) ? $wp_local_package : '',
- 'blogs' => $num_blogs,
- 'users' => $user_count,
- 'multisite_enabled' => $multisite_enabled,
- 'initial_db_version' => get_site_option( 'initial_db_version' ),
+ 'version' => $wp_version,
+ 'php' => 'N/A',
+ 'locale' => 'C',
+ 'mysql' => 'N/A',
+ 'local_package' => isset( $wp_local_package ) ? $wp_local_package : '',
+ 'blogs' => 31337,
+ 'users' => 31337,
+ 'multisite_enabled' => 0,
+ 'initial_db_version' => 31337
);
/**
@@ -152,13 +152,9 @@
$doing_cron = wp_doing_cron(); $doing_cron = wp_doing_cron();
$options = array( $options = array(
...@@ -21,15 +39,15 @@ index 79eb1c68..eab29591 100644 ...@@ -21,15 +39,15 @@ index 79eb1c68..eab29591 100644
- 'headers' => array( - 'headers' => array(
- 'wp_install' => $wp_install, - 'wp_install' => $wp_install,
- 'wp_blog' => home_url( '/' ), - 'wp_blog' => home_url( '/' ),
+ 'timeout' => $doing_cron ? 30 : 3, - ),
- 'body' => $post_body,
+ 'timeout' => $doing_cron ? 30 : 3,
+ 'user-agent' => 'WordPress/' . $wp_version . '; http://wordpress.org', + 'user-agent' => 'WordPress/' . $wp_version . '; http://wordpress.org',
+ 'headers' => array( + 'body' => $post_body,
+ 'wp_install' => home_url( '/' ),
+ 'wp_blog' => home_url( '/' )
),
'body' => $post_body,
); );
@@ -363,7 +363,7 @@ function wp_update_plugins( $extra_stats = array() ) {
$response = wp_remote_post( $url, $options );
@@ -381,7 +377,7 @@
'locale' => wp_json_encode( $locales ), 'locale' => wp_json_encode( $locales ),
'all' => wp_json_encode( true ), 'all' => wp_json_encode( true ),
), ),
...@@ -38,7 +56,7 @@ index 79eb1c68..eab29591 100644 ...@@ -38,7 +56,7 @@ index 79eb1c68..eab29591 100644
); );
if ( $extra_stats ) { if ( $extra_stats ) {
@@ -553,7 +553,7 @@ function wp_update_themes( $extra_stats = array() ) { @@ -585,7 +581,7 @@
'translations' => wp_json_encode( $translations ), 'translations' => wp_json_encode( $translations ),
'locale' => wp_json_encode( $locales ), 'locale' => wp_json_encode( $locales ),
), ),
...@@ -47,6 +65,3 @@ index 79eb1c68..eab29591 100644 ...@@ -47,6 +65,3 @@ index 79eb1c68..eab29591 100644
); );
if ( $extra_stats ) { if ( $extra_stats ) {
--
2.17.1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment