chore: uuid string guard in revoke, docblock placement, stricter schedule warning test
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user