Make WordPress Core

Changeset 559


Ignore:
Timestamp:
11/30/2003 12:55:19 AM (21 years ago)
Author:
mikelittle
Message:

Fixed several instances in WordPress where PHP Notices are not being handled correctly.
Fixes supplied by Aaron Jensen (aaron@…).

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/b2-include/b2functions.php

    r558 r559  
    294294    global $smilies_directory, $use_smilies;
    295295    global $b2_smiliessearch, $b2_smiliesreplace;
    296 
     296    $output = '';
    297297    if ($use_smilies) {
    298298        // HTML loop taken from texturize function, could possible be consolidated
     
    301301        for ($i = 0; $i < $stop; $i++) {
    302302            $content = $textarr[$i];
    303             if ('<' != $content{0}) { // If it's not a tag
     303            if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag
    304304                $content = str_replace($b2_smiliessearch, $b2_smiliesreplace, $content);
    305305            }
     
    16291629    if (isset($b2_filter['all'])) {
    16301630        $b2_filter['all'] = (is_string($b2_filter['all'])) ? array($b2_filter['all']) : $b2_filter['all'];
    1631         $b2_filter[$tag] = array_merge($b2_filter['all'], $b2_filter[$tag]);
     1631        if (isset($b2_filter[$tag]))
     1632            $b2_filter[$tag] = array_merge($b2_filter['all'], $b2_filter[$tag]);
     1633        else
     1634            $b2_filter[$tag] = array_merge($b2_filter['all'], array());
    16321635        $b2_filter[$tag] = array_unique($b2_filter[$tag]);
    16331636    }
  • trunk/b2-include/b2template.functions.php

    r558 r559  
    920920    }
    921921    if ($cut) {
     922        $excerpt = '';
    922923        $blah = explode(' ', $output);
    923924        if (count($blah) > $cut) {
     
    971972            $use_dotdotdot = 0;
    972973        }
     974        $excerpt = '';
    973975        for ($i=0; $i<$k; $i++) {
    974976            $excerpt .= $blah[$i].' ';
     
    12281230        $file = "$siteurl/$blogfilename";
    12291231    }
     1232    if ('http:' != substr($file,0,5)) {
     1233        $file = "$siteurl/$file";
     1234    }
    12301235    $link = $file.$querystring_start.'cat'.$querystring_equal.$cat_ID;
    12311236    if ($echo)
  • trunk/b2comments.php

    r558 r559  
    1111        }
    1212
    13         $comment_author = trim($HTTP_COOKIE_VARS["comment_author_".$cookiehash]);
    14         $comment_author_email = trim($HTTP_COOKIE_VARS["comment_author_email_".$cookiehash]);
    15         $comment_author_url = trim($HTTP_COOKIE_VARS["comment_author_url_".$cookiehash]);
     13        $comment_author = (isset($HTTP_COOKIE_VARS['comment_author_'.$cookiehash])) ? trim($HTTP_COOKIE_VARS['comment_author_'.$cookiehash]) : '';
     14        $comment_author_email = (isset($HTTP_COOKIE_VARS['comment_author_email_'.$cookiehash])) ? trim($HTTP_COOKIE_VARS['comment_author_email_'.$cookiehash]) : '';
     15        $comment_author_url = (isset($HTTP_COOKIE_VARS['comment_author_url_'.$cookiehash])) ? trim($HTTP_COOKIE_VARS['comment_author_url_'.$cookiehash]) : '';
    1616
    1717        $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date");
  • trunk/blog.header.php

    r558 r559  
    4242
    4343/* Getting settings from db */
    44 if ($doing_rss == 1)
     44if (isset($doing_rss) && $doing_rss == 1)
    4545    $posts_per_page=get_settings('posts_per_rss');
    46 if ($posts_per_page == 0)
     46if (!isset($posts_per_page) || $posts_per_page == 0)
    4747    $posts_per_page = get_settings('posts_per_page');
    4848$what_to_show = get_settings('what_to_show');
     
    6262if ($pagenow != 'wp-post.php') { timer_start(); }
    6363
    64 if ($showposts) {
     64if (isset($showposts) && $showposts) {
    6565    $showposts = (int)$showposts;
    6666    $posts_per_page = $showposts;
     
    289289
    290290// Get private posts
    291 if ('' != intval($user_ID)) $where .= " OR post_author = $user_ID AND post_status != 'draft')"; else $where .= ')';
     291if (isset($user_ID) && ('' != intval($user_ID)))
     292    $where .= " OR  post_author = $user_ID AND post_status != 'draft')";
     293else
     294    $where .= ')';
    292295$request = " SELECT $distinct * FROM $tableposts WHERE 1=1".$where." ORDER BY post_$orderby $limits";
    293296
  • trunk/wp-rss.php

    r558 r559  
    22         In every template you do, you got to copy them before the CafeLog 'loop' */
    33$blog = 1; // enter your blog's ID
    4 $doing_rss=1;
     4$doing_rss = 1;
    55header('Content-type: text/xml',true);
    66include('blog.header.php');
     
    99
    1010// Get the time of the most recent article
    11 $sql = "SELECT max(post_date) FROM $tableposts";
    12 
    13 $maxdate = $wpdb->get_var($sql);
     11$maxdate = $wpdb->get_var("SELECT max(post_date) FROM $tableposts");
    1412++$querycount;
    1513$unixtime = strtotime($maxdate);
    1614
    1715// format timestamp for Last-Modified header
    18 $clast = gmdate("D, d M Y H:i:s \G\M\T",$unixtime);
    19 $cetag = md5($last);
     16$clast = gmdate("D, d M Y H:i:s \G\M\T", $unixtime);
     17$cetag = (isset($last)) ? md5($last) : '';
    2018
    21 $slast = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
    22 $setag = $_SERVER['HTTP_IF_NONE_MATCH'];
     19$slast = (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : '' ;
     20$setag = (isset($_SERVER['HTTP_IF_NONE_MATCH'])) ? $_SERVER['HTTP_IF_NONE_MATCH'] : '';
    2321
    2422// send it in a Last-Modified header
     
    3331// generated values.
    3432//if (($slast?($slast == $clast):true) && ($setag?($setag == $cetag):true)){
    35 if (($slast && $setag)?(($slast == $clast) && ($setag == $cetag)):(($slast == $clast) || ($setag == $cetag))) {
    36     header("HTTP/1.1 304 Not Modified");
    37     echo "\r\n\r\n";
    38     exit;
     33if (($slast != '') && ($setag != '')) {
     34    if (($slast == $clast) && ($setag == $cetag)) {
     35        header("HTTP/1.1 304 Not Modified");
     36        echo "\r\n\r\n";
     37        exit;
     38    } else if (($slast == $clast)
     39               || ($setag == $cetag)) {
     40        header("HTTP/1.1 304 Not Modified");
     41        echo "\r\n\r\n";
     42        exit;
     43    }
    3944}
    4045
  • trunk/wp-settings.php

    r542 r559  
    55// get_settings() wherever these are needed OR
    66// accessing a single global $all_settings var
    7 if (!$_wp_installing) {
     7if (!isset($_wp_installing) || !$_wp_installing) {
    88    $siteurl = get_settings('siteurl');
    99    // "When trying to design a foolproof system,
Note: See TracChangeset for help on using the changeset viewer.