Make WordPress Core

Ticket #30518: 30518.patch

File 30518.patch, 1.1 KB (added by ccomp5950, 11 years ago)
  • wp-includes/class.wp-dependencies.php

     
    331331         *
    332332         * @param array  $queue  An array of queued _WP_Dependency handle objects.
    333333         * @param string $handle Name of the item. Should be unique.
     334         * @param int    $depth  Counts down to 0, to prevent infinite recursions.
    334335         * @return boolean Whether the handle is found after recursively searching the dependency tree.
    335336         */
    336         protected function recurse_deps( $queue, $handle ) {
     337        protected function recurse_deps( $queue, $handle, $depth=15) {
    337338                foreach ( $queue as $queued ) {
    338339                        if ( ! isset( $this->registered[ $queued ] ) ) {
    339340                                continue;
     
    341342
    342343                        if ( in_array( $handle, $this->registered[ $queued ]->deps ) ) {
    343344                                return true;
    344                         } elseif ( $this->recurse_deps( $this->registered[ $queued ]->deps, $handle ) ) {
     345                        } elseif ($depth && $this->recurse_deps( $this->registered[ $queued ]->deps, $handle, --$depth ) ) {
    345346                                return true;
    346347                        }
    347348                }