mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 11:14:36 +00:00
Coding Standards: Extract extract() from the codebase.
Of the last four instances of `extract()` occurring, three of them are removed by this commit, and the fourth is appropriately documented. See #45934. git-svn-id: https://develop.svn.wordpress.org/trunk@44569 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -684,6 +684,15 @@ function load_template( $_template_file, $require_once = true ) {
|
||||
global $posts, $post, $wp_did_header, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;
|
||||
|
||||
if ( is_array( $wp_query->query_vars ) ) {
|
||||
/*
|
||||
* This use of extract() cannot be removed. There are many possible ways that
|
||||
* templates could depend on variables that it creates existing, and no way to
|
||||
* detect and deprecate it.
|
||||
*
|
||||
* Passing the EXTR_SKIP flag is the safest option, ensuring globals and
|
||||
* function variables cannot be overwritten.
|
||||
*/
|
||||
// phpcs:ignore WordPress.PHP.DontExtract.extract_extract
|
||||
extract( $wp_query->query_vars, EXTR_SKIP );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user