Changeset 5447
- Timestamp:
- 05/11/2007 03:44:03 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r5149 r5447 57 57 58 58 function get_theme_data( $theme_file ) { 59 $themes_allowed_tags = array( 60 'a' => array( 61 'href' => array(),'title' => array() 62 ), 63 'abbr' => array( 64 'title' => array() 65 ), 66 'acronym' => array( 67 'title' => array() 68 ), 69 'code' => array(), 70 'em' => array(), 71 'strong' => array() 72 ); 73 59 74 $theme_data = implode( '', file( $theme_file ) ); 60 75 $theme_data = str_replace ( '\r', '\n', $theme_data ); … … 65 80 preg_match( '|Author URI:(.*)|i', $theme_data, $author_uri ); 66 81 preg_match( '|Template:(.*)|i', $theme_data, $template ); 82 67 83 if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) ) 68 $version = trim( $version[1]);84 $version = wp_kses( trim( $version[1] ), $themes_allowed_tags ); 69 85 else 70 $version =''; 86 $version = ''; 87 71 88 if ( preg_match('|Status:(.*)|i', $theme_data, $status) ) 72 $status = trim($status[1]);89 $status = wp_kses( trim( $status[1] ), $themes_allowed_tags ); 73 90 else 74 91 $status = 'publish'; 75 76 $ description = wptexturize( trim( $description[1] ));77 78 $ name = $theme_name[1];79 $ name = trim( $name);80 $theme = $name;81 $ theme_uri = trim( $theme_uri[1]);82 83 if ( '' == $author_uri[1]) {84 $author = trim( $author_name[1]);92 93 $name = $theme = wp_kses( trim( $theme_name[1] ), $themes_allowed_tags ); 94 $theme_uri = clean_url( trim( $theme_uri[1] ) ); 95 $description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) ); 96 $template = wp_kses( trim( $template[1] ), $themes_allowed_tags ); 97 98 $author_uri = clean_url( trim( $author_uri[1] ) ); 99 100 if ( empty( $author_uri[1] ) ) { 101 $author = wp_kses( trim( $author_name[1] ), $themes_allowed_tags ); 85 102 } else { 86 $author = '<a href="' . trim( $author_uri[1] ) . '" title="' . __('Visit author homepage') . '">' . trim( $author_name[1] ) . '</a>';103 $author = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $author_uri, __( 'Visit author homepage' ), wp_kses( trim( $author_name[1] ), $themes_allowed_tags ) ); 87 104 } 88 105
Note: See TracChangeset
for help on using the changeset viewer.