Make WordPress Core


Ignore:
Timestamp:
01/12/2019 03:19:23 AM (6 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/template.php

    r42678 r44569  
    685685
    686686    if ( is_array( $wp_query->query_vars ) ) {
     687        /*
     688         * This use of extract() cannot be removed. There are many possible ways that
     689         * templates could depend on variables that it creates existing, and no way to
     690         * detect and deprecate it.
     691         *
     692         * Passing the EXTR_SKIP flag is the safest option, ensuring globals and
     693         * function variables cannot be overwritten.
     694         */
     695        // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
    687696        extract( $wp_query->query_vars, EXTR_SKIP );
    688697    }
Note: See TracChangeset for help on using the changeset viewer.