try adding a simple check for numeric - #28
Conversation
This has never existed. https://core.trac.wordpress.org/changeset/37894/
…a little more readable. Add string checks for the second conditional further down.
|
I updated the conditional to use There was another conditional a bit deeper that could also potentially cause this error when checking against old menu locations. There is no test for this scenario currently, though. The last test method can be copied and modified. Also, I moved the @aaronjorbin is the first diff in |
This reverts commit 8af68b0.
pento
left a comment
There was a problem hiding this comment.
Just the one question, everything else looks good.
|
|
||
| // Don't destroy the initial, main, or root blog. | ||
| if ( $drop && ( 1 == $blog_id || is_main_site( $blog_id ) || ( $blog->path == $current_network->path && $blog->domain == $current_network->domain ) ) ) { | ||
| if ( $drop && $blog && ( 1 == $blog_id || is_main_site( $blog_id ) || ( $blog->path == $current_network->path && $blog->domain == $current_network->domain ) ) ) { |
There was a problem hiding this comment.
Why isn't this being caught in the if ( $drop && ! $blog ) check just before it?
There was a problem hiding this comment.
Hmm, that's a good question. The issue this was solving was that $blog wasn't an object.
See: https://travis-ci.org/WordPress/wordpress-develop/jobs/445966625#L1411
I think that there is a chance we aren't setting the environment up completely correctly and that could be causing this.
|
|
||
| // ...actually match! | ||
| if ( false === stripos( $new_location, $slug ) && false === stripos( $slug, $new_location ) ) { | ||
| if ( is_string( $new_location ) && false === stripos( $new_location, $slug ) && false === stripos( |
There was a problem hiding this comment.
This broke the tests.
|
This was committed in https://core.trac.wordpress.org/changeset/43899. |
…workstreams Addresses all 51 findings from code review o006 (34 numbered, 11 module, 6 security). Two of the six binding targets now pass and every unmet target improved; the four that remain short are documented against the AAP sections that exclude the work required to close them. Implemented, not merely disclosed: * wp-settings.php: defer the two admin-only files the plan mandates off the front-end path. wp-admin/includes/plugin.php is required only when a plugin is active or is_admin(); WP_Site_Health is instantiated only for admin, cron and WP-CLI. 6,533 lines stop being tokenized on every front-end request, and the Site Health class map entry stops being a zero-delta entry. (WordPress#13, A2) * capabilities.php: deliver the map_meta_cap() memoization the plan prescribes and the previous round withdrew. Branch-scoped to the four post arms, keyed on every input that can change the result including the post type's cap object, bypassed when a non-core map_meta_cap callback is present, and the filter still runs on every call. Measured -8.8% cold / -8.0% warm over 7/7 interleaved rounds. (WordPress#12) * autoload.php: is_readable() replaces file_exists() at both guards so an existing-but-unreadable file degrades instead of raising an uncatchable E_COMPILE_ERROR; the path-confinement pattern is anchored with \z so a value carrying a trailing newline cannot pass a guard advertised as canonical; CompileError is re-raised while any other Error is reported under WP_DEBUG through wp_trigger_error(). (WordPress#15, WordPress#16, WordPress#17, S2, S3) * formatting.php: scope the emoji gate to the front end, the only context the plan measured, pass the context to the filter, and restore trunk's $printed ordering. (WordPress#20, WordPress#21, C1) * script-loader.php: publish the documented one-line rollback for the Command Palette gate and name both consequences - wp.commands/wp.coreCommands undefined and the Ctrl+K button absent - in the predicate's docblock. (WordPress#18, WordPress#19, B1) * class-wp-object-cache.php: stop stats() emitting an advisory paragraph on the default path, so its public output matches trunk exactly. (WordPress#23, WordPress#22, D1) * Gruntfile.js: move verify:build-guards out of every production build into precommit and prerelease, and classify ENOENT at both host-php spawn sites. (WordPress#24, WordPress#25) * server-timing.php: refuse to serve the reset endpoint when the pre-existing unauthenticated clear-cache.php is provisioned beside it. (WordPress#29, S5) * admin.test.js / utils.js: collect JavaScript by Content-Type as well as by .js pathname, which was under-counting by ~99,019 gzipped bytes in both arms whenever CONCATENATE_SCRIPTS is active. (WordPress#30, WordPress#31) * generate-autoload-classmap.php: @return never on the fail-closed exit. Clears the one PHPStan error the file had. (WordPress#28) * build-guards.test.js: prettier-clean. (WordPress#33) New committed coverage for behaviour that shipped with none - 34 cases: tests/phpunit/tests/dependencies/commandPalette.php (7), tests/phpunit/tests/formatting/emojiGate.php (6), tests/phpunit/tests/cache/objectCacheGroupStats.php (8), tests/phpunit/tests/user/mapMetaCapMemoization.php (13). (B2, C2, D1) docs/performance-optimization-report.md rewritten against a fresh before/after pair captured under one interpreter regime with 40 samples per metric per scenario over 18 scenarios. Every stale artifact reference, blob id and digest is replaced; the ephemeral self-check machinery is replaced with in-tree re-runnable commands; the emoji, files-loaded, byte-size, PHPStan/PHPCS coverage and 216-construct claims are corrected; a Security invariants section records Gate 7 and findings S1, S4 and S6; and a before/after loading-flow diagram is added. (WordPress#1-WordPress#11, WordPress#14, WordPress#26, WordPress#27, WordPress#31, WordPress#32, WordPress#34, A1, A3, C3, H1, S1, S4, S6) Verification: PHPUnit 29,165 single-site and 29,957 multisite with 0 failures and 0 errors, warning and skip counts identical to the pre-change baseline; QUnit 456/456; E2E exit 0; performance suite 820 passed in both arms and compare-results.js exit 0; PHPStan exit 0 over 1,414 files; PHPCS exit 0; production and dev builds clean with no drift and build/ byte-identical to src/.
Trac ticket: https://core.trac.wordpress.org/ticket/45018