Changeset 1643
- Timestamp:
- Dec 8, 2006, 1:12:44 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/action.php
r1616 r1643 56 56 function do_error( $code, $str ) 57 57 { 58 header("HTTP/1.1 $code "); 59 header("Status: $code "); 58 set_status_header( $code ); 60 59 echo $str ; 61 60 exit(); … … 149 148 if ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) 150 149 { 151 header("HTTP/1.1 304 Not modified "); 152 header("Status: 304 Not modified"); 150 set_status_header(304); 153 151 foreach ($http_headers as $header) 154 152 { -
trunk/include/category_cats.inc.php
r1641 r1643 66 66 while ($row = mysql_fetch_assoc($result)) 67 67 { 68 $row['is_child_date_last'] = isset($row['date_last']) 69 and $row['max_date_last']>$row['date_last']; 68 $row['is_child_date_last'] = @$row['max_date_last']>@$row['date_last']; 70 69 71 70 if (isset($row['representative_picture_id']) -
trunk/include/functions_html.inc.php
r1641 r1643 482 482 $menu.= '</span>'; 483 483 } 484 $child_date_last = isset($category['date_last']) 485 and $category['max_date_last']>$category['date_last'] ; 484 $child_date_last = @$category['max_date_last']> @$category['date_last']; 486 485 $menu.= get_icon($category['max_date_last'], $child_date_last); 487 486 } … … 610 609 else 611 610 { 612 header('HTTP/1.1 401 Authorization required'); 613 header('Status: 401 Authorization required'); 611 set_status_header(401); 614 612 redirect($login_url); 615 613 } … … 623 621 function page_not_found($msg, $alternate_url=null) 624 622 { 625 header('HTTP/1.1 404 Not found'); 626 header('Status: 404 Not found'); 623 set_status_header(404); 627 624 if ($alternate_url==null) 628 625 $alternate_url = make_index_url(); … … 681 678 return $title; 682 679 } 680 681 /** 682 Sets the http status header (200,401,...) 683 */ 684 function set_status_header($code, $text='') 685 { 686 if (empty($text)) 687 { 688 switch ($code) 689 { 690 case 200: $text='OK';break; 691 case 301: $text='Moved permanently';break; 692 case 302: $text='Moved temporarily';break; 693 case 304: $text='Not modified';break; 694 case 400: $text='Bad request';break; 695 case 401: $text='Authorization required';break; 696 case 403: $text='Forbidden';break; 697 case 404: $text='Not found';break; 698 } 699 } 700 header("HTTP/1.1 $code $text"); 701 header("Status: $code $text"); 702 } 683 703 ?>
Note: See TracChangeset
for help on using the changeset viewer.