From 3722d822698dd39882a391e163bacd1ba76856f8 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 29 Jun 2009 20:48:12 +0000 Subject: [PATCH] Check that token_get_all() exists before creating documentation links. fixes #10261 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@11671 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/misc.php | 3 +++ wp-admin/plugin-editor.php | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index b717f65a5..356c6b001 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -272,6 +272,9 @@ function wp_doc_link_parse( $content ) { if ( !is_string( $content ) || empty( $content ) ) return array(); + if ( !function_exists('token_get_all') ) + return array(); + $tokens = token_get_all( $content ); $functions = array(); $ignore_functions = array(); diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index 813c1e476..fb6fba4ae 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -111,12 +111,14 @@ default: if ( '.php' == substr( $real_file, strrpos( $real_file, '.' ) ) ) { $functions = wp_doc_link_parse( $content ); - $docs_select = ''; + $docs_select .= ''; + foreach ( $functions as $function) { + $docs_select .= ''; + } + $docs_select .= ''; } - $docs_select .= ''; } $content = htmlspecialchars( $content ); @@ -204,7 +206,7 @@ foreach ( $plugin_files as $plugin_file ) : - +