Skip to content

Commit 1815244

Browse files
committed
Merge branch 'trunk' into scrub-pseudo-elements
2 parents 5594079 + bbc90ae commit 1815244

29 files changed

+742
-133
lines changed

.github/workflows/reusable-phpunit-tests-v1.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ jobs:
8787
name: PHP ${{ inputs.php }} / ${{ inputs.multisite && ' Multisite' || 'Single site' }}${{ inputs.split_slow && ' slow tests' || '' }}${{ inputs.memcached && ' with memcached' || '' }}
8888
runs-on: ${{ inputs.os }}
8989
timeout-minutes: 20
90+
permissions:
91+
contents: read
9092

9193
steps:
9294
- name: Configure environment variables

.github/workflows/reusable-phpunit-tests-v2.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ jobs:
8989
name: PHP ${{ inputs.php }} / ${{ inputs.multisite && ' Multisite' || 'Single Site' }}${{ inputs.split_slow && ' slow tests' || '' }}${{ inputs.memcached && ' with memcached' || '' }}
9090
runs-on: ${{ inputs.os }}
9191
timeout-minutes: 20
92+
permissions:
93+
contents: read
9294

9395
steps:
9496
- name: Configure environment variables

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
"env:reset": "node ./tools/local-env/scripts/docker.js down --rmi all -v --remove-orphans",
185185
"env:install": "node ./tools/local-env/scripts/install.js",
186186
"env:cli": "node ./tools/local-env/scripts/docker.js exec --user wp_php cli wp",
187+
"env:composer": "node ./tools/local-env/scripts/docker.js run -T --rm php composer",
187188
"env:logs": "node ./tools/local-env/scripts/docker.js logs",
188189
"env:pull": "node ./tools/local-env/scripts/docker.js pull",
189190
"test:performance": "wp-scripts test-playwright --config tests/performance/playwright.config.js",

phpcompat.xml.dist

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,28 @@
7676
#############################################################################
7777
-->
7878

79+
<rule ref="PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved">
80+
<exclude-pattern>/ID3/getid3\.php$</exclude-pattern>
81+
</rule>
82+
<rule ref="PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated">
83+
<exclude-pattern>/ID3/getid3\.php$</exclude-pattern>
84+
<exclude-pattern>/PHPMailer/PHPMailer\.php$</exclude-pattern>
85+
</rule>
86+
<rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated">
87+
<exclude-pattern>/ID3/getid3\.php$</exclude-pattern>
88+
</rule>
89+
<rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_gpcDeprecated">
90+
<exclude-pattern>/ID3/getid3\.php$</exclude-pattern>
91+
</rule>
92+
<rule ref="PHPCompatibility.Lists.AssignmentOrder.Affected">
93+
<exclude-pattern>/ID3/module.audio-video.quicktime\.php$</exclude-pattern>
94+
</rule>
95+
<rule ref="PHPCompatibility.Constants.RemovedConstants.intl_idna_variant_2003Deprecated">
96+
<exclude-pattern>/PHPMailer/PHPMailer\.php$</exclude-pattern>
97+
</rule>
98+
<rule ref="PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet">
99+
<exclude-pattern>/PHPMailer/PHPMailer\.php$</exclude-pattern>
100+
</rule>
79101
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_sign_keypair_from_secretkey_and_publickeyFound">
80102
<exclude-pattern>/sodium_compat/src/Compat\.php$</exclude-pattern>
81103
</rule>
@@ -85,5 +107,11 @@
85107
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.sodium_unpadFound">
86108
<exclude-pattern>/sodium_compat/src/Compat\.php$</exclude-pattern>
87109
</rule>
110+
<rule ref="PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__serializeFound">
111+
<exclude-pattern>/sodium_compat/src/PHP52/SplFixedArray\.php$</exclude-pattern>
112+
</rule>
113+
<rule ref="PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound">
114+
<exclude-pattern>/sodium_compat/src/PHP52/SplFixedArray\.php$</exclude-pattern>
115+
</rule>
88116

89117
</ruleset>

src/wp-admin/includes/upgrade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3203,7 +3203,7 @@ function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.N
32033203
$fieldtype_base = strtok( $fieldtype_without_parentheses, ' ' );
32043204

32053205
// Is actual field type different from the field type in query?
3206-
if ( $tablefield->Type !== $fieldtype ) {
3206+
if ( $tablefield->Type !== $fieldtype_lowercased ) {
32073207
$do_change = true;
32083208
if ( in_array( $fieldtype_lowercased, $text_fields, true ) && in_array( $tablefield_type_lowercased, $text_fields, true ) ) {
32093209
if ( array_search( $fieldtype_lowercased, $text_fields, true ) < array_search( $tablefield_type_lowercased, $text_fields, true ) ) {

src/wp-includes/ID3/getid3.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,31 +425,27 @@ public function __construct() {
425425
}
426426

427427
// Check safe_mode off
428-
if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
428+
if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) {
429429
$this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.');
430430
}
431431

432-
// phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
433432
if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {
434433
// http://php.net/manual/en/mbstring.overload.php
435434
// "mbstring.func_overload in php.ini is a positive value that represents a combination of bitmasks specifying the categories of functions to be overloaded. It should be set to 1 to overload the mail() function. 2 for string functions, 4 for regular expression functions"
436435
// getID3 cannot run when string functions are overloaded. It doesn't matter if mail() or ereg* functions are overloaded since getID3 does not use those.
437-
// phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
438436
$this->startup_error .= 'WARNING: php.ini contains "mbstring.func_overload = '.ini_get('mbstring.func_overload').'", getID3 cannot run with this setting (bitmask 2 (string functions) cannot be set). Recommended to disable entirely.'."\n";
439437
}
440438

441439
// check for magic quotes in PHP < 5.4.0 (when these options were removed and getters always return false)
442440
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
443441
// Check for magic_quotes_runtime
444442
if (function_exists('get_magic_quotes_runtime')) {
445-
// phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_runtimeDeprecated
446443
if (get_magic_quotes_runtime()) { // @phpstan-ignore-line
447444
$this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'."\n";
448445
}
449446
}
450447
// Check for magic_quotes_gpc
451448
if (function_exists('get_magic_quotes_gpc')) {
452-
// phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.get_magic_quotes_gpcDeprecated
453449
if (get_magic_quotes_gpc()) { // @phpstan-ignore-line
454450
$this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'."\n";
455451
}
@@ -1790,7 +1786,6 @@ public function getHashdata($algorithm) {
17901786
// page sequence numbers likely happens for OggSpeex and OggFLAC as well, but
17911787
// currently vorbiscomment only works on OggVorbis files.
17921788

1793-
// phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
17941789
if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) {
17951790

17961791
$this->warning('Failed making system call to vorbiscomment.exe - '.$algorithm.'_data is incorrect - error returned: PHP running in Safe Mode (backtick operator not available)');

src/wp-includes/ID3/module.audio-video.quicktime.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ public function Analyze() {
144144
foreach ($info['quicktime']['comments']['location.ISO6709'] as $ISO6709string) {
145145
$ISO6709parsed = array('latitude'=>false, 'longitude'=>false, 'altitude'=>false);
146146
if (preg_match('#^([\\+\\-])([0-9]{2}|[0-9]{4}|[0-9]{6})(\\.[0-9]+)?([\\+\\-])([0-9]{3}|[0-9]{5}|[0-9]{7})(\\.[0-9]+)?(([\\+\\-])([0-9]{3}|[0-9]{5}|[0-9]{7})(\\.[0-9]+)?)?/$#', $ISO6709string, $matches)) {
147-
// phpcs:ignore PHPCompatibility.Lists.AssignmentOrder.Affected
148147
@list($dummy, $lat_sign, $lat_deg, $lat_deg_dec, $lon_sign, $lon_deg, $lon_deg_dec, $dummy, $alt_sign, $alt_deg, $alt_deg_dec) = $matches;
149148

150149
if (strlen($lat_deg) == 2) { // [+-]DD.D

src/wp-includes/PHPMailer/PHPMailer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ public function __destruct()
876876
private function mailPassthru($to, $subject, $body, $header, $params)
877877
{
878878
//Check overloading of mail function to avoid double-encoding
879-
if ((int)ini_get('mbstring.func_overload') & 1) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
879+
if ((int)ini_get('mbstring.func_overload') & 1) {
880880
$subject = $this->secureHeader($subject);
881881
} else {
882882
$subject = $this->encodeHeader($this->secureHeader($subject));
@@ -1532,11 +1532,9 @@ public function punyencodeAddress($address)
15321532
);
15331533
} elseif (defined('INTL_IDNA_VARIANT_2003')) {
15341534
//Fall back to this old, deprecated/removed encoding
1535-
// phpcs:ignore PHPCompatibility.Constants.RemovedConstants.intl_idna_variant_2003Deprecated
15361535
$punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003);
15371536
} else {
15381537
//Fall back to a default we don't know about
1539-
// phpcs:ignore PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet
15401538
$punycode = idn_to_ascii($domain, $errorcode);
15411539
}
15421540
if (false !== $punycode) {

src/wp-includes/class-wp-block-bindings-registry.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,13 @@ public function is_registered( $source_name ) {
257257
}
258258

259259
/**
260-
* Wakeup magic method.
260+
* Unserialize magic method.
261261
*
262-
* @since 6.5.0
262+
* @since 6.9.0
263+
*
264+
* @param array $data Data to unserialize.
263265
*/
264-
public function __wakeup() {
266+
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
265267
if ( ! $this->sources ) {
266268
return;
267269
}
@@ -275,6 +277,15 @@ public function __wakeup() {
275277
}
276278
}
277279

280+
/**
281+
* Wakeup magic method.
282+
*
283+
* @since 6.5.0
284+
*/
285+
public function __wakeup() {
286+
$this->__unserialize( array() );
287+
}
288+
278289
/**
279290
* Utility method to retrieve the main instance of the class.
280291
*

src/wp-includes/class-wp-block-bindings-source.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,23 @@ public function get_value( array $source_args, $block_instance, string $attribut
9898
return apply_filters( 'block_bindings_source_value', $value, $this->name, $source_args, $block_instance, $attribute_name );
9999
}
100100

101+
/**
102+
* Unserialize magic method.
103+
*
104+
* @since 6.9.0
105+
*
106+
* @param array $data Data to unserialize.
107+
*/
108+
public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
109+
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
110+
}
111+
101112
/**
102113
* Wakeup magic method.
103114
*
104115
* @since 6.5.0
105116
*/
106117
public function __wakeup() {
107-
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
118+
$this->__unserialize( array() );
108119
}
109120
}

0 commit comments

Comments
 (0)