chore: uuid string guard in revoke, docblock placement, stricter schedule warning test

This commit is contained in:
2026-09-26 05:07:35 +02:00
parent 6ed63ec008
commit 50f0f98c8e
5 changed files with 22 additions and 6 deletions
+2 -1
View File
@@ -39,7 +39,8 @@ final class Rev
* title, url and linked object. Other item data (classes, target, …) is never rewritten
* by the tool and therefore not part of the lock.
*
* @param list<object> $items wp_get_nav_menu_items() result.
* @param array<int|string, object> $items wp_get_nav_menu_items() result – may have gaps in
* its keys (core filters it), only the order counts.
*/
public static function ofMenu(array $items): string
{
+3 -1
View File
@@ -121,7 +121,9 @@ final class AccessTab implements AdminTab
}
// phpcs:disable WordPress.Security.NonceVerification.Missing -- verified right below.
$uuid = isset($_POST['uuid']) ? sanitize_text_field(wp_unslash((string) $_POST['uuid'])) : '';
$uuid = isset($_POST['uuid']) && is_string($_POST['uuid'])
? sanitize_text_field(wp_unslash($_POST['uuid']))
: '';
$userId = isset($_POST['user_id']) ? absint($_POST['user_id']) : 0;
// phpcs:enable WordPress.Security.NonceVerification.Missing
check_admin_referer(self::REVOKE_ACTION . '_' . $uuid);
+3 -3
View File
@@ -60,12 +60,12 @@ class MediaUsageFinder
private const EXCLUDED_STATUSES = "'auto-draft', 'trash', 'inherit'";
/**
* @param Closure(): list<string> $mediaMetaKeys Keys of file/image fields (ContentSchema::mediaFieldKeys()).
*/
/** Set by results() when a query of the current collect() run failed. */
private bool $queryFailed = false;
/**
* @param Closure(): list<string> $mediaMetaKeys Keys of file/image fields (ContentSchema::mediaFieldKeys()).
*/
public function __construct(private Closure $mediaMetaKeys, private ?\wpdb $db = null)
{
}