WordPress.org

Ready to get started?Download WordPress

Forums

Junk code in wp-includes/functions.php (1 post)

  1. frankindelicato
    Member
    Posted 4 years ago #

    I loaded the WordPress code into the Eclipse PHP IDE and it immediately detected two blocks of HTML that are embedded into the source and caused errors. I checked an untouched svn version of the source code and it is the same. The problem is also in Wp-mu. You can search for Doctype in functions.php to find the problem. Removing the code also causes a PHP parser problem with an unbalanced function closing tag in function function wp_die the fix for that issue is:

    Old code in wp_die:
    
    if ( !function_exists( 'did_action' ) || !did_action( 'admin_head' ) ) :
    	if( !headers_sent() ){
    		status_header( $r['response'] );
    		nocache_headers();
    		header( 'Content-Type: text/html; charset=utf-8' );
    	}
    
    New code in wp_die (replace the ":" with "{} open/closing" :
    	if ( !function_exists( 'did_action' ) || !did_action( 'admin_head' ) )
            {
    	  if( !headers_sent() )
              {
    		status_header( $r['response'] );
    		nocache_headers();
    		header( 'Content-Type: text/html; charset=utf-8' );
    	  }
           }

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 4 years ago by frankindelicato
  • This topic is not resolved
  • WordPress version: 2.9.1