Use jetpack autoloader and composer instead of namespace rewrite

This commit is contained in:
David Stone
2025-02-02 01:22:03 -07:00
parent 1e02e42706
commit 71b0e7a455
3479 changed files with 4128 additions and 379511 deletions

View File

@ -0,0 +1,26 @@
--- /dev/null
+++ ../src/Database/Column.php
@@ -506,10 +506,10 @@
'binary' => 'wp_validate_boolean',
'allow_null' => 'wp_validate_boolean',
'default' => array( $this, 'sanitize_default' ),
- 'extra' => 'wp_kses_data',
- 'encoding' => 'wp_kses_data',
- 'collation' => 'wp_kses_data',
- 'comment' => 'wp_kses_data',
+ 'extra' => 'wu_kses_data',
+ 'encoding' => 'wu_kses_data',
+ 'collation' => 'wu_kses_data',
+ 'comment' => 'wu_kses_data',
'primary' => 'wp_validate_boolean',
'created' => 'wp_validate_boolean',
@@ -675,7 +675,7 @@
// String
} elseif ( is_string( $default ) ) {
- return wp_kses_data( $default );
+ return wu_kses_data( $default );
// Integer
} elseif ( $this->is_numeric() ) {

View File

@ -0,0 +1,11 @@
--- /dev/null
+++ ../src/Database/Query.php
@@ -2169,7 +2169,7 @@
$caps = $this->get_column_field( array( 'name' => $key ), 'caps' );
// Unset if not explicitly allowed
- if ( empty( $caps[ $method ] ) || ! current_user_can( $caps[ $method ] ) ) {
+ if ( empty( $caps[ $method ] ) ) {
if ( is_array( $item ) ) {
unset( $item[ $key ] );
} elseif ( is_object( $item ) ) {

View File

@ -0,0 +1,32 @@
--- /dev/null
+++ ../src/Broker/Cookies.php
@@ -43,7 +43,8 @@
/**
* @inheritDoc
*/
- public function offsetSet($name, $value)
+ #[\ReturnTypeWillChange]
+ public function offsetSet($name, $value)
{
$success = setcookie($name, $value, time() + $this->ttl, $this->path, $this->domain, $this->secure, true);
@@ -66,7 +67,8 @@
/**
* @inheritDoc
*/
- public function offsetGet($name)
+ #[\ReturnTypeWillChange]
+ public function offsetGet($name)
{
return $_COOKIE[$name] ?? null;
}
@@ -74,7 +76,8 @@
/**
* @inheritDoc
*/
- public function offsetExists($name)
+ #[\ReturnTypeWillChange]
+ public function offsetExists($name)
{
return isset($_COOKIE[$name]);
}