WordPress.org

Make WordPress Core

Ticket #27214: patch.diff

File patch.diff, 1.0 KB (added by pross, 6 years ago)
  • wp-admin/includes/misc.php

    diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php
    index 10d72d5..7f6cdd4 100644
    a b function wp_doc_link_parse( $content ) { 
    317317        $functions = array();
    318318        $ignore_functions = array();
    319319        for ( $t = 0, $count = count( $tokens ); $t < $count; $t++ ) {
    320                 if ( !is_array( $tokens[$t] ) ) continue;
    321                 if ( T_STRING == $tokens[$t][0] && ( '(' == $tokens[ $t + 1 ] || '(' == $tokens[ $t + 2 ] ) ) {
     320                if (  ! is_array( $tokens[$t] ) ) continue;
     321                if ( isset( $tokens[$t][0] ) && T_STRING == $tokens[$t][0] && ( isset( $tokens[ $t + 1 ] ) && '(' == $tokens[ $t + 1 ] || isset( $tokens[ $t + 2 ] ) && '(' == $tokens[ $t + 2 ] ) ) {
    322322                        // If it's a function or class defined locally, there's not going to be any docs available
    323323                        if ( ( isset( $tokens[ $t - 2 ][1] ) && in_array( $tokens[ $t - 2 ][1], array( 'function', 'class' ) ) ) || ( isset( $tokens[ $t - 2 ][0] ) && T_OBJECT_OPERATOR == $tokens[ $t - 1 ][0] ) ) {
    324324                                $ignore_functions[] = $tokens[$t][1];