Changeset 934

Show
Ignore:
Timestamp:
03/26/07 11:04:22 (2 years ago)
Author:
donncha
Message:

WP Merge to rev 5109

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/edit.php

    r909 r934  
    6565} else { 
    6666        if ( is_single() ) 
    67                 printf(__('Comments on %s'), $post->post_title); 
     67                printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title)); 
    6868        elseif ( ! is_paged() || get_query_var('paged') == 1 ) 
    6969                _e('Last 15 Posts'); 
  • trunk/wp-admin/upgrade-functions.php

    r909 r934  
    2222        update_option('blog_public', $public); 
    2323        $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 
    2530        update_option('siteurl', $guessurl); 
    2631 
  • trunk/wp-admin/wp-admin.css

    r928 r934  
    489489        list-style: none; 
    490490        text-align: center; 
     491        white-space: nowrap; 
    491492} 
    492493 
  • trunk/wp-content/themes/default/archive.php

    r817 r934  
    77                 <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?> 
    88<?php /* If this is a category archive */ if (is_category()) { ?> 
    9                 <h2 class="pagetitle">Archive for the &#8216;<?php echo single_cat_title(); ?>&#8217; Category</h2> 
     9                <h2 class="pagetitle">Archive for the &#8216;<?php single_cat_title(); ?>&#8217; Category</h2> 
    1010 
    1111          <?php /* If this is a daily archive */ } elseif (is_day()) { ?> 
  • trunk/wp-includes/comment-template.php

    r933 r934  
    162162} 
    163163 
    164 function comments_number( $zero = false, $one = false, $more = false, $number = '' ) { 
     164function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) { 
    165165        global $id; 
    166166        $number = get_comments_number($id); 
  • trunk/wp-includes/default-filters.php

    r920 r934  
    146146add_filter('option_ping_sites', 'privacy_ping_filter'); 
    147147add_filter('option_blog_charset', 'wp_specialchars'); 
     148add_filter('option_home', '_config_wp_home'); 
     149add_filter('option_siteurl', '_config_wp_siteurl'); 
    148150add_filter('mce_plugins', '_mce_load_rtl_plugin'); 
    149151add_filter('mce_buttons', '_mce_add_direction_buttons'); 
  • trunk/wp-includes/formatting.php

    r933 r934  
    10751075        // Append http unless a relative link starting with / or a php file. 
    10761076        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) ) 
    10781078                $url = 'http://' . $url; 
    10791079         
    1080         $url = (strpos($url, '://') === false && substr( $url, 0, 1 ) != '/' ) ? 'http://'.$url : $url; 
    10811080        $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url); 
    10821081        if ( !is_array($protocols) ) 
  • trunk/wp-includes/functions.php

    r933 r934  
    10131013        $installed = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'"); 
    10141014        $wpdb->show_errors(); 
    1015         return $installed; 
     1015 
     1016        $install_status = !empty( $installed ) ? TRUE : FALSE; 
     1017        return $install_status; 
    10161018} 
    10171019 
     
    13691371<?php 
    13701372        die(); 
     1373} 
     1374 
     1375function _config_wp_home($url = '') { 
     1376        if ( defined( 'WP_HOME' ) )  
     1377                return WP_HOME; 
     1378        else return $url; 
     1379} 
     1380 
     1381function _config_wp_siteurl($url = '') { 
     1382        if ( defined( 'WP_SITEURL' ) )  
     1383                return WP_SITEURL; 
     1384        else return $url; 
    13711385} 
    13721386 
  • trunk/wp-includes/general-template.php

    r920 r934  
    202202                $my_year = substr($m, 0, 4); 
    203203                $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" : ""); 
    205206        } 
    206207 
  • trunk/wp-includes/js/tinymce/tiny_mce_gzip.php

    r875 r934  
    11<?php 
    22/** 
    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 $ 
    64 * 
    7  * @version 1.08 
    85 * @author Moxiecode 
    96 * @copyright Copyright  2005-2006, Moxiecode Systems AB, All rights reserved. 
     
    1411 */ 
    1512 
    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); 
    14449        $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        } 
    145100 
    146101if ($index > -1) { 
    147102        // 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;'; 
    152108        } else 
    153                 TinyMCE_echo('tinyMCE = realTinyMCE;'); 
    154  
     109                $content .= 'tinyMCE = realTinyMCE;'; 
     110 
     111        // Patch loading functions 
     112        //$content .= "tinyMCE_GZ.start();"; 
     113         
    155114        // Do init based on index 
    156         TinyMCE_echo("tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);")
     115        $content .= "tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);"
    157116 
    158117        // 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 
    173134        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")); // WP 
    182         } 
     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); 
    183144 
    184145        // 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"); 
    199209                if ($fp) { 
    200                         fwrite($fp, $cacheData); 
     210                        fwrite($fp, $content); 
    201211                        fclose($fp); 
    202212                } 
    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        } 
    211230?> 
    212231 
  • trunk/wp-includes/script-loader.php

    r920 r934  
    1616                $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3517' ); 
    1717                $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' ); 
    18                 $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20070124' ); 
     18                $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20070325' ); 
    1919                $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); 
    2020                $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20070225' ); 
  • trunk/wp-includes/template-loader.php

    r550 r934  
    44        if ( is_robots() ) { 
    55                do_action('do_robots'); 
    6                 exit
     6                return
    77        } else if ( is_feed() ) { 
    88                do_feed(); 
    9                 exit
     9                return
    1010        } else if ( is_trackback() ) { 
    1111                include(ABSPATH . '/wp-trackback.php'); 
    12                 exit
     12                return
    1313        } else if ( is_404() && $template = get_404_template() ) { 
    1414                include($template); 
    15                 exit
     15                return
    1616        } else if ( is_search() && $template = get_search_template() ) { 
    1717                include($template); 
    18                 exit
     18                return
    1919        } else if ( is_home() && $template = get_home_template() ) { 
    2020                include($template); 
    21                 exit
     21                return
    2222        } else if ( is_attachment() && $template = get_attachment_template() ) { 
    2323                include($template); 
    24                 exit
     24                return
    2525        } else if ( is_single() && $template = get_single_template() ) { 
    2626                if ( is_attachment() ) 
    2727                        add_filter('the_content', 'prepend_attachment'); 
    2828                include($template); 
    29                 exit
     29                return
    3030        } else if ( is_page() && $template = get_page_template() ) { 
    3131                if ( is_attachment() ) 
    3232                        add_filter('the_content', 'prepend_attachment'); 
    3333                include($template); 
    34                 exit
     34                return
    3535        } else if ( is_category() && $template = get_category_template()) { 
    3636                include($template); 
    37                 exit
     37                return
    3838        } else if ( is_author() && $template = get_author_template() ) { 
    3939                include($template); 
    40                 exit
     40                return
    4141        } else if ( is_date() && $template = get_date_template() ) { 
    4242                include($template); 
    43                 exit
     43                return
    4444        } else if ( is_archive() && $template = get_archive_template() ) { 
    4545                include($template); 
    46                 exit
     46                return
    4747        } else if ( is_comments_popup() && $template = get_comments_popup_template() ) { 
    4848                include($template); 
    49                 exit
     49                return
    5050        } else if ( is_paged() && $template = get_paged_template() ) { 
    5151                include($template); 
    52                 exit
     52                return
    5353        } else if ( file_exists(TEMPLATEPATH . "/index.php") ) { 
    5454                if ( is_attachment() ) 
    5555                        add_filter('the_content', 'prepend_attachment'); 
    5656                include(TEMPLATEPATH . "/index.php"); 
    57                 exit
     57                return
    5858        } 
    5959} else { 
     
    6161        if ( is_robots() ) { 
    6262                do_action('do_robots'); 
    63                 exit
     63                return
    6464        } else if ( is_feed() ) { 
    6565                do_feed(); 
    66                 exit
     66                return
    6767        } else if ( is_trackback() ) { 
    6868                include(ABSPATH . '/wp-trackback.php'); 
    69                 exit
     69                return
    7070        } 
    7171} 
  • trunk/xmlrpc.php

    r933 r934  
    262262 
    263263                // Lookup info on pages. 
    264                 $pages = array(); 
    265264                $pages = get_pages(); 
    266265                $num_pages = count($pages); 
     
    281280                // If no pages were found return an error. 
    282281                else { 
    283                         return(new IXR_Error(404, "Sorry, no pages were found.")); 
     282                        return(array()); 
    284283                } 
    285284        } 
     
    11011100 
    11021101          $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 
    11031110          extract($postdata); 
    11041111                $this->escape($postdata); 
     
    16161623                 support per-post text filters yet */ 
    16171624        function mt_supportedTextFilters($args) { 
    1618                 return array(); 
     1625                return apply_filters('xmlrpc_text_filters', array()); 
    16191626        } 
    16201627