From 87bb8cd69cc593fe6bed330fb1791eac9df87167 Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 23 Oct 2007 18:28:40 +0000 Subject: Merge with WordPress, rev 6285 and untested git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1125 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/general-template.php | 57 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) (limited to 'wp-includes/general-template.php') diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 9af63b6..de8318c 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -208,7 +208,7 @@ function wp_title($sep = '»', $display = true) { } if ( !empty($author_name) ) { // We do a direct query here because we don't cache by nicename. - $title = $wpdb->get_var("SELECT display_name FROM $wpdb->users WHERE user_nicename = '$author_name'"); + $title = $wpdb->get_var($wpdb->prepare("SELECT display_name FROM $wpdb->users WHERE user_nicename = %s", $author_name)); } // If there's a month @@ -255,7 +255,7 @@ function single_post_title($prefix = '', $display = true) { if ( intval($p) || '' != $name ) { if ( !$p ) - $p = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '$name'"); + $p = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s", $name)); $post = & get_post($p); $title = $post->post_title; $title = apply_filters('single_post_title', $title); @@ -363,7 +363,7 @@ function wp_get_archives($args = '') { $type = 'monthly'; if ( '' != $limit ) { - $limit = (int) $limit; + $limit = abs(intval($limit)); $limit = ' LIMIT '.$limit; } @@ -829,6 +829,11 @@ function rsd_link() { echo ' \n"; } +function wlwmanifest_link() { + echo ' '; +} + function noindex() { global $current_blog; // If the blog is not public, tell robots to go away. @@ -1071,4 +1076,50 @@ function wp_admin_css( $file = 'wp-admin' ) { } } +/** + * Outputs the XHTML generator that is generated on the wp_head hook. + */ +function wp_generator() +{ + the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) ); +} + +/** + * Outputs the generator XML or Comment for RSS, ATOM, etc. + * @param {String} $type The type of generator to return. + */ +function the_generator ( $type ) { + echo apply_filters('the_generator',get_the_generator($type),$type) . "\n"; +} + +/** + * Creates the generator XML or Comment for RSS, ATOM, etc. + * @param {String} $type The type of generator to return. + */ +function get_the_generator ( $type ) { + switch ($type) { + case 'html': + $gen = ''; + break; + case 'xhtml': + $gen = ''; + break; + case 'atom': + $gen = 'WordPress'; + break; + case 'rss2': + $gen = 'http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . ''; + break; + case 'rdf': + $gen = ''; + break; + case 'comment': + $gen = ''; + break; + case 'export': + $gen = ''; + break; + } + return apply_filters( "get_the_generator_{$type}", $gen, $type ); +} ?> -- cgit