Project

General

Profile

Actions

Feature #15194

open

PHPCS sniff for un-restored switch_to_blog() calls

Added by Boone Gorges almost 3 years ago. Updated 5 months ago.

Status:
New
Priority name:
Normal
Assignee:
Category name:
Internal Tools and Workflow
Target version:
Start date:
2022-01-14
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

When switch_to_blog() is called but not properly "closed" via restore_current_blog(), havoc ensues. The most recent instance of this is #15170.

We should introduce a PHPCS sniff to our custom ruleset that looks for switch_to_blog(), and then ensures that all code paths out of the method have a restore_current_blog() before returning.

Actions

Also available in: Atom PDF