Make WordPress Core

Changeset 559 for trunk/wp-rss.php


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.