[wp-trac] [WordPress Trac] #59712: `WP_Ugrader` doesn't check source and destination variable types, is missing a string.
WordPress Trac
noreply at wordpress.org
Thu Apr 11 22:32:13 UTC 2024
#59712: `WP_Ugrader` doesn't check source and destination variable types, is
missing a string.
-------------------------------------------------+-------------------------
Reporter: peterwilsoncc | Owner:
| peterwilsoncc
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.6
Component: Upgrade/Install | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests needs- | Focuses:
testing |
-------------------------------------------------+-------------------------
Comment (by peterwilsoncc):
@afragen @costdev Do you think the check should be this instead?
{{{#!php
<?php
if (
( ! is_string( $source ) || $source !== trim( $source ) ) ||
( ! is_string( $destination ) || $destination !== trim(
$destination ) )
) {
}}}
An alternative would be to reassign the values with their trimmed versions
and check for an empty string.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59712#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list