Changeset 934
- Timestamp:
- 03/26/07 11:04:22 (2 years ago)
- Files:
-
- trunk/wp-admin/edit.php (modified) (1 diff)
- trunk/wp-admin/upgrade-functions.php (modified) (1 diff)
- trunk/wp-admin/wp-admin.css (modified) (1 diff)
- trunk/wp-content/themes/default/archive.php (modified) (1 diff)
- trunk/wp-includes/comment-template.php (modified) (1 diff)
- trunk/wp-includes/default-filters.php (modified) (1 diff)
- trunk/wp-includes/formatting.php (modified) (1 diff)
- trunk/wp-includes/functions.php (modified) (2 diffs)
- trunk/wp-includes/general-template.php (modified) (1 diff)
- trunk/wp-includes/js/tinymce/tiny_mce_gzip.php (modified) (2 diffs)
- trunk/wp-includes/script-loader.php (modified) (1 diff)
- trunk/wp-includes/template-loader.php (modified) (2 diffs)
- trunk/xmlrpc.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/edit.php
r909 r934 65 65 } else { 66 66 if ( is_single() ) 67 printf(__('Comments on %s'), $post->post_title);67 printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title)); 68 68 elseif ( ! is_paged() || get_query_var('paged') == 1 ) 69 69 _e('Last 15 Posts'); trunk/wp-admin/upgrade-functions.php
r909 r934 22 22 update_option('blog_public', $public); 23 23 $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 24 $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 24 25 if ( defined('WP_SITEURL') && '' != WP_SITEURL ) 26 $guessurl = WP_SITEURL; 27 else 28 $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 29 25 30 update_option('siteurl', $guessurl); 26 31 trunk/wp-admin/wp-admin.css
r928 r934 489 489 list-style: none; 490 490 text-align: center; 491 white-space: nowrap; 491 492 } 492 493 trunk/wp-content/themes/default/archive.php
r817 r934 7 7 <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?> 8 8 <?php /* If this is a category archive */ if (is_category()) { ?> 9 <h2 class="pagetitle">Archive for the ‘<?php echosingle_cat_title(); ?>’ Category</h2>9 <h2 class="pagetitle">Archive for the ‘<?php single_cat_title(); ?>’ Category</h2> 10 10 11 11 <?php /* If this is a daily archive */ } elseif (is_day()) { ?> trunk/wp-includes/comment-template.php
r933 r934 162 162 } 163 163 164 function comments_number( $zero = false, $one = false, $more = false, $ number= '' ) {164 function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) { 165 165 global $id; 166 166 $number = get_comments_number($id); trunk/wp-includes/default-filters.php
r920 r934 146 146 add_filter('option_ping_sites', 'privacy_ping_filter'); 147 147 add_filter('option_blog_charset', 'wp_specialchars'); 148 add_filter('option_home', '_config_wp_home'); 149 add_filter('option_siteurl', '_config_wp_siteurl'); 148 150 add_filter('mce_plugins', '_mce_load_rtl_plugin'); 149 151 add_filter('mce_buttons', '_mce_add_direction_buttons'); trunk/wp-includes/formatting.php
r933 r934 1075 1075 // Append http unless a relative link starting with / or a php file. 1076 1076 if ( strpos($url, '://') === false && 1077 substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9]+ .php/i', $url) )1077 substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9]+?\.php/i', $url) ) 1078 1078 $url = 'http://' . $url; 1079 1079 1080 $url = (strpos($url, '://') === false && substr( $url, 0, 1 ) != '/' ) ? 'http://'.$url : $url;1081 1080 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 1082 1081 if ( !is_array($protocols) ) trunk/wp-includes/functions.php
r933 r934 1013 1013 $installed = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'"); 1014 1014 $wpdb->show_errors(); 1015 return $installed; 1015 1016 $install_status = !empty( $installed ) ? TRUE : FALSE; 1017 return $install_status; 1016 1018 } 1017 1019 … … 1369 1371 <?php 1370 1372 die(); 1373 } 1374 1375 function _config_wp_home($url = '') { 1376 if ( defined( 'WP_HOME' ) ) 1377 return WP_HOME; 1378 else return $url; 1379 } 1380 1381 function _config_wp_siteurl($url = '') { 1382 if ( defined( 'WP_SITEURL' ) ) 1383 return WP_SITEURL; 1384 else return $url; 1371 1385 } 1372 1386 trunk/wp-includes/general-template.php
r920 r934 202 202 $my_year = substr($m, 0, 4); 203 203 $my_month = $wp_locale->get_month($m); 204 $title = "$my_year $sep $my_month"; 204 $my_day = intval(substr($m, 6, 2)); 205 $title = "$my_year" . ($my_month ? "$sep $my_month" : "") . ($my_day ? "$sep $my_day" : ""); 205 206 } 206 207 trunk/wp-includes/js/tinymce/tiny_mce_gzip.php
r875 r934 1 1 <?php 2 2 /** 3 * $RCSfile: tiny_mce_gzip.php,v $ 4 * $Revision: $ 5 * $Date: $ 3 * $Id: tiny_mce_gzip.php 158 2006-12-21 14:32:19Z spocke $ 6 4 * 7 * @version 1.088 5 * @author Moxiecode 9 6 * @copyright Copyright 2005-2006, Moxiecode Systems AB, All rights reserved. … … 14 11 */ 15 12 16 @require_once('../../../wp-config.php'); 17 18 // gzip_compression(); 19 20 function wp_tinymce_lang($path) { 21 global $language; 22 23 $text = ''; 24 25 // Look for xx_YY.js, xx_yy.js, xx.js 26 $file = realpath(sprintf($path, $language)); 27 if ( file_exists($file) ) 28 $text = file_get_contents($file); 29 $file = realpath(sprintf($path, strtolower($language))); 30 if ( file_exists($file) ) 31 $text = file_get_contents($file); 32 $file = realpath(sprintf($path, substr($language, 0, 2))); 33 if ( file_exists($file) ) 34 $text = file_get_contents($file); 35 36 37 // Fall back on en.js 38 $file = realpath(sprintf($path, 'en')); 39 if ( empty($text) && file_exists($file) ) 40 $text = file_get_contents($file); 41 42 // Send lang file through gettext 43 if ( function_exists('__') && strtolower(substr($language, 0, 2)) != 'en' ) { 44 $search1 = "/^tinyMCELang\\[(['\"])(.*)\\1\]( ?= ?)(['\"])(.*)\\4/Uem"; 45 $replace1 = "'tinyMCELang[\\1\\2\\1]\\3'.stripslashes('\\4').__('\\5').stripslashes('\\4')"; 46 47 $search2 = "/\\s:\\s(['\"])(.*)\\1(,|\\s*})/Uem"; 48 $replace2 = "' : '.stripslashes('\\1').__('\\2').stripslashes('\\1').'\\3'"; 49 50 $search = array($search1, $search2); 51 $replace = array($replace1, $replace2); 52 53 $text = preg_replace($search, $replace, $text); 54 55 return $text; 56 } 57 58 return $text; 59 } 60 61 function wp_compact_tinymce_js($text) { 62 // This function was custom-made for TinyMCE 2.0, not expected to work with any other JS. 63 64 // Strip comments 65 $text = preg_replace("!(^|\s+)//.*$!m", '', $text); 66 $text = preg_replace("!/\*.*?\*/!s", '', $text); 67 68 // Strip leading tabs, carriage returns and unnecessary line breaks. 69 $text = preg_replace("!^\t+!m", '', $text); 70 $text = str_replace("\r", '', $text); 71 $text = preg_replace("!(^|{|}|;|:|\))\n!m", '\\1', $text); 72 73 return "$text\n"; 74 } 75 76 77 // General options 78 $suffix = ""; // Set to "_src" to use source version 79 $expiresOffset = 3600 * 24 * 10; // 10 days util client cache expires 80 $diskCache = false; // If you enable this option gzip files will be cached on disk. 81 $cacheDir = realpath("."); // Absolute directory path to where cached gz files will be stored 82 $debug = false; // Enable this option if you need debuging info 83 84 // Headers 85 header("Content-Type: text/javascript; charset=" . get_bloginfo('charset')); 86 // header("Cache-Control: must-revalidate"); 87 header("Vary: Accept-Encoding"); // Handle proxies 88 header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expiresOffset) . " GMT"); 89 90 // Get data to load 91 $theme = isset($_GET['theme']) ? TinyMCE_cleanInput($_GET['theme']) : ""; 92 $language = isset($_GET['language']) ? TinyMCE_cleanInput($_GET['language']) : ""; 93 $plugins = isset($_GET['plugins']) ? TinyMCE_cleanInput($_GET['plugins']) : ""; 94 $lang = isset($_GET['lang']) ? TinyMCE_cleanInput($_GET['lang']) : "en"; 95 $index = isset($_GET['index']) ? TinyMCE_cleanInput($_GET['index']) : -1; 96 $cacheKey = md5($theme . $language . $plugins . $lang . $index . $debug); 97 $cacheFile = $cacheDir == "" ? "" : $cacheDir . "/" . "tinymce_" . $cacheKey . ".gz"; 98 $cacheData = ""; 99 100 // Patch older versions of PHP < 4.3.0 101 if (!function_exists('file_get_contents')) { 102 function file_get_contents($filename) { 103 $fd = fopen($filename, 'rb'); 104 $content = fread($fd, filesize($filename)); 105 fclose($fd); 106 return $content; 107 } 108 } 109 110 // Security check function, can only contain a-z 0-9 , _ - and whitespace. 111 function TinyMCE_cleanInput($str) { 112 return preg_replace("/[^0-9a-z\-_,]+/i", "", $str); // Remove anything but 0-9,a-z,-_ 113 } 114 115 function TinyMCE_echo($str) { 116 global $cacheData, $diskCache; 117 118 if ($diskCache) 119 $cacheData .= $str; 120 else 121 echo $str; 122 } 123 124 // Only gzip the contents if clients and server support it 125 $encodings = array(); 126 127 if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) 128 $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING']))); 129 130 // Check for gzip header or northon internet securities 131 if ((in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) { 132 $enc = in_array('x-gzip', $encodings) ? "x-gzip" : "gzip"; 133 134 // Use cached file if it exists but not in debug mode 135 if (file_exists($cacheFile) && !$debug) { 136 header("Content-Encoding: " . $enc); 137 echo file_get_contents($cacheFile); 138 die; 139 } 140 141 if (!$diskCache) 142 ob_start("ob_gzhandler"); 143 } else 13 @require_once('../../../wp-config.php'); // For get_bloginfo(). 14 15 // Get input 16 $plugins = explode(',', getParam("plugins", "")); 17 $languages = explode(',', getParam("languages", "")); 18 $themes = explode(',', getParam("themes", "")); 19 $diskCache = getParam("diskcache", "") == "true"; 20 $isJS = getParam("js", "") == "true"; 21 $compress = getParam("compress", "true") == "true"; 22 $suffix = getParam("suffix", "_src") == "_src" ? "_src" : ""; 23 $cachePath = realpath("."); // Cache path, this is where the .gz files will be stored 24 $expiresOffset = 3600 * 24 * 10; // Cache for 10 days in browser cache 25 $content = ""; 26 $encodings = array(); 27 $supportsGzip = false; 28 $enc = ""; 29 $cacheKey = ""; 30 31 // Custom extra javascripts to pack 32 $custom = array(/* 33 "some custom .js file", 34 "some custom .js file" 35 */); 36 37 // WP 38 $index = getParam("index", -1); 39 $theme = getParam("theme", ""); 40 $themes = array($theme); 41 $language = getParam("language", "en"); 42 if ( empty($language) ) 43 $language = 'en'; 44 $languages = array($language); 45 if ( $language != strtolower($language) ) 46 $languages[] = strtolower($language); 47 if ( $language != substr($language, 0, 2) ) 48 $languages[] = substr($language, 0, 2); 144 49 $diskCache = false; 50 $isJS = true; 51 $suffix = ''; 52 53 // Headers 54 header("Content-Type: text/javascript; charset=" . get_bloginfo('charset')); 55 header("Vary: Accept-Encoding"); // Handle proxies 56 header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expiresOffset) . " GMT"); 57 58 // Is called directly then auto init with default settings 59 if (!$isJS) { 60 echo getFileContents("tiny_mce_gzip.js"); 61 echo "tinyMCE_GZ.init({});"; 62 die(); 63 } 64 65 // Setup cache info 66 if ($diskCache) { 67 if (!$cachePath) 68 die("alert('Real path failed.');"); 69 70 $cacheKey = getParam("plugins", "") . getParam("languages", "") . getParam("themes", ""); 71 72 foreach ($custom as $file) 73 $cacheKey .= $file; 74 75 $cacheKey = md5($cacheKey); 76 77 if ($compress) 78 $cacheFile = $cachePath . "/tiny_mce_" . $cacheKey . ".gz"; 79 else 80 $cacheFile = $cachePath . "/tiny_mce_" . $cacheKey . ".js"; 81 } 82 83 // Check if it supports gzip 84 if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) 85 $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING']))); 86 87 if ((in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) { 88 $enc = in_array('x-gzip', $encodings) ? "x-gzip" : "gzip"; 89 $supportsGzip = true; 90 } 91 92 // Use cached file disk cache 93 if ($diskCache && $supportsGzip && file_exists($cacheFile)) { 94 if ($compress) 95 header("Content-Encoding: " . $enc); 96 97 echo getFileContents($cacheFile); 98 die(); 99 } 145 100 146 101 if ($index > -1) { 147 102 // Write main script and patch some things 148 if ($index == 0) { 149 TinyMCE_echo(wp_compact_tinymce_js(file_get_contents(realpath("tiny_mce" . $suffix . ".js")))); // WP 150 TinyMCE_echo('TinyMCE.prototype.orgLoadScript = TinyMCE.prototype.loadScript;'); 151 TinyMCE_echo('TinyMCE.prototype.loadScript = function() {};var realTinyMCE = tinyMCE;'); 103 if ( $index == 0 ) { 104 // Add core 105 $content .= wp_compact_tinymce_js(getFileContents("tiny_mce" . $suffix . ".js")); 106 $content .= 'TinyMCE.prototype.orgLoadScript = TinyMCE.prototype.loadScript;'; 107 $content .= 'TinyMCE.prototype.loadScript = function() {};var realTinyMCE = tinyMCE;'; 152 108 } else 153 TinyMCE_echo('tinyMCE = realTinyMCE;'); 154 109 $content .= 'tinyMCE = realTinyMCE;'; 110 111 // Patch loading functions 112 //$content .= "tinyMCE_GZ.start();"; 113 155 114 // Do init based on index 156 TinyMCE_echo("tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);");115 $content .= "tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);"; 157 116 158 117 // Load external plugins 159 if ($index == 0) 160 TinyMCE_echo("tinyMCECompressed.loadPlugins();"); 161 162 // Load theme, language pack and theme language packs 163 if ($theme) { 164 TinyMCE_echo(wp_compact_tinymce_js(file_get_contents(realpath("themes/" . $theme . "/editor_template" . $suffix . ".js")))); // WP 165 TinyMCE_echo(wp_tinymce_lang("themes/" . $theme . "/langs/%s.js")); // WP 166 } 167 168 /* WP if ($language) WP */ 169 TinyMCE_echo(wp_tinymce_lang("langs/%s.js")); // WP 170 171 // Load all plugins and their language packs 172 $plugins = explode(",", $plugins); 118 if ( $index == 0 ) 119 $content .= "tinyMCECompressed.loadPlugins();"; 120 121 // Add core languages 122 foreach ($languages as $lang) 123 $content .= getFileContents("langs/" . $lang . ".js"); 124 125 // Add themes 126 foreach ($themes as $theme) { 127 $content .= wp_compact_tinymce_js(getFileContents( "themes/" . $theme . "/editor_template" . $suffix . ".js")); 128 129 foreach ($languages as $lang) 130 $content .= getFileContents("themes/" . $theme . "/langs/" . $lang . ".js"); 131 } 132 133 // Add plugins 173 134 foreach ($plugins as $plugin) { 174 $ pluginFile = realpath("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js");175 /* WP $languageFile = realpath("plugins/" . $plugin . "/langs/" . $lang . ".js"); WP */ 176 177 if ($pluginFile)178 TinyMCE_echo(file_get_contents($pluginFile));179 180 /* WP if ($languageFile) WP */181 TinyMCE_echo(wp_tinymce_lang("plugins/" . $plugin . "/langs/%s.js")); // WP182 }135 $content .= getFileContents("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js"); 136 137 foreach ($languages as $lang) 138 $content .= getFileContents("plugins/" . $plugin . "/langs/" . $lang . ".js"); 139 } 140 141 // Add custom files 142 foreach ($custom as $file) 143 $content .= getFileContents($file); 183 144 184 145 // Reset tinyMCE compressor engine 185 TinyMCE_echo("tinyMCE = tinyMCECompressed;"); 186 187 // Write to cache 188 if ($diskCache) { 189 // Calculate compression ratio and debug target output path 190 if ($debug) { 191 $ratio = round(100 - strlen(gzencode($cacheData, 9, FORCE_GZIP)) / strlen($cacheData) * 100.0); 192 TinyMCE_echo("alert('TinyMCE was compressed by " . $ratio . "%.\\nOutput cache file: " . $cacheFile . "');"); 193 } 194 195 $cacheData = gzencode($cacheData, 9, FORCE_GZIP); 196 197 // Write to file if possible 198 $fp = @fopen($cacheFile, "wb"); 146 $content .= "tinyMCE = tinyMCECompressed;"; 147 148 // Restore loading functions 149 //$content .= "tinyMCE_GZ.end();"; 150 151 // Generate GZIP'd content 152 if ($supportsGzip) { 153 if ($compress) { 154 header("Content-Encoding: " . $enc); 155 $cacheData = gzencode($content, 9, FORCE_GZIP); 156 } else 157 $cacheData = $content; 158 159 // Write gz file 160 if ($diskCache && $cacheKey != "") 161 putFileContents($cacheFile, $cacheData); 162 163 // Stream to client 164 echo $cacheData; 165 } else { 166 // Stream uncompressed content 167 echo $content; 168 } 169 170 die; 171 } 172 173 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 174 175 function getParam($name, $def = false) { 176 if (!isset($_GET[$name])) 177 return $def; 178 179 return preg_replace("/[^0-9a-z\-_,]+/i", "", $_GET[$name]); // Remove anything but 0-9,a-z,-_ 180 } 181 182 function getFileContents($path) { 183 $path = realpath($path); 184 185 if (!$path || !@is_file($path)) 186 return ""; 187 188 if (function_exists("file_get_contents")) 189 return @file_get_contents($path); 190 191 $content = ""; 192 $fp = @fopen($path, "r"); 193 if (!$fp) 194 return ""; 195 196 while (!feof($fp)) 197 $content .= fgets($fp); 198 199 fclose($fp); 200 201 return $content; 202 } 203 204 function putFileContents($path, $content) { 205 if (function_exists("file_put_contents")) 206 return @file_put_contents($path, $content); 207 208 $fp = @fopen($path, "wb"); 199 209 if ($fp) { 200 fwrite($fp, $c acheData);210 fwrite($fp, $content); 201 211 fclose($fp); 202 212 } 203 204 // Output 205 header("Content-Encoding: " . $enc); 206 echo $cacheData; 207 } 208 209 die; 210 } 213 } 214 215 // WP specific 216 function wp_compact_tinymce_js($text) { 217 // This function was custom-made for TinyMCE 2.0, not expected to work with any other JS. 218 219 // Strip comments 220 $text = preg_replace("!(^|\s+)//.*$!m", '', $text); 221 $text = preg_replace("!/\*.*?\*/!s", '', $text); 222 223 // Strip leading tabs, carriage returns and unnecessary line breaks. 224 $text = preg_replace("!^\t+!m", '', $text); 225 $text = str_replace("\r", '', $text); 226 $text = preg_replace("!(^|{|}|;|:|\))\n!m", '\\1', $text); 227 228 return "$text\n"; 229 } 211 230 ?> 212 231 trunk/wp-includes/script-loader.php
r920 r934 16 16 $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3517' ); 17 17 $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' ); 18 $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20070 124' );18 $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20070325' ); 19 19 $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); 20 20 $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20070225' ); trunk/wp-includes/template-loader.php
r550 r934 4 4 if ( is_robots() ) { 5 5 do_action('do_robots'); 6 exit;6 return; 7 7 } else if ( is_feed() ) { 8 8 do_feed(); 9 exit;9 return; 10 10 } else if ( is_trackback() ) { 11 11 include(ABSPATH . '/wp-trackback.php'); 12 exit;12 return; 13 13 } else if ( is_404() && $template = get_404_template() ) { 14 14 include($template); 15 exit;15 return; 16 16 } else if ( is_search() && $template = get_search_template() ) { 17 17 include($template); 18 exit;18 return; 19 19 } else if ( is_home() && $template = get_home_template() ) { 20 20 include($template); 21 exit;21 return; 22 22 } else if ( is_attachment() && $template = get_attachment_template() ) { 23 23 include($template); 24 exit;24 return; 25 25 } else if ( is_single() && $template = get_single_template() ) { 26 26 if ( is_attachment() ) 27 27 add_filter('the_content', 'prepend_attachment'); 28 28 include($template); 29 exit;29 return; 30 30 } else if ( is_page() && $template = get_page_template() ) { 31 31 if ( is_attachment() ) 32 32 add_filter('the_content', 'prepend_attachment'); 33 33 include($template); 34 exit;34 return; 35 35 } else if ( is_category() && $template = get_category_template()) { 36 36 include($template); 37 exit;37 return; 38 38 } else if ( is_author() && $template = get_author_template() ) { 39 39 include($template); 40 exit;40 return; 41 41 } else if ( is_date() && $template = get_date_template() ) { 42 42 include($template); 43 exit;43 return; 44 44 } else if ( is_archive() && $template = get_archive_template() ) { 45 45 include($template); 46 exit;46 return; 47 47 } else if ( is_comments_popup() && $template = get_comments_popup_template() ) { 48 48 include($template); 49 exit;49 return; 50 50 } else if ( is_paged() && $template = get_paged_template() ) { 51 51 include($template); 52 exit;52 return; 53 53 } else if ( file_exists(TEMPLATEPATH . "/index.php") ) { 54 54 if ( is_attachment() ) 55 55 add_filter('the_content', 'prepend_attachment'); 56 56 include(TEMPLATEPATH . "/index.php"); 57 exit;57 return; 58 58 } 59 59 } else { … … 61 61 if ( is_robots() ) { 62 62 do_action('do_robots'); 63 exit;63 return; 64 64 } else if ( is_feed() ) { 65 65 do_feed(); 66 exit;66 return; 67 67 } else if ( is_trackback() ) { 68 68 include(ABSPATH . '/wp-trackback.php'); 69 exit;69 return; 70 70 } 71 71 } trunk/xmlrpc.php
r933 r934 262 262 263 263 // Lookup info on pages. 264 $pages = array();265 264 $pages = get_pages(); 266 265 $num_pages = count($pages); … … 281 280 // If no pages were found return an error. 282 281 else { 283 return( new IXR_Error(404, "Sorry, no pages were found."));282 return(array()); 284 283 } 285 284 } … … 1101 1100 1102 1101 $postdata = wp_get_single_post($post_ID, ARRAY_A); 1102 1103 // If there is no post data for the give post id, stop 1104 // now and return an error. Other wise a new post will be 1105 // created (which was the old behavior). 1106 if(empty($postdata["ID"])) { 1107 return(new IXR_Error(404, "Invalid post id.")); 1108 } 1109 1103 1110 extract($postdata); 1104 1111 $this->escape($postdata); … … 1616 1623 support per-post text filters yet */ 1617 1624 function mt_supportedTextFilters($args) { 1618 return a rray();1625 return apply_filters('xmlrpc_text_filters', array()); 1619 1626 } 1620 1627
