Changeset 4006

Show
Ignore:
Timestamp:
07/10/06 05:29:10 (2 years ago)
Author:
ryan
Message:

wp_die() improvements from Sewar. fixes #2902

Files:

Legend:

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

    r3517 r4006  
    44 
    55if ( ! current_user_can('edit_posts') ) 
    6     die ("Cheatin' uh?"); 
     6    wp_die(__('Cheatin’ uh?')); 
    77 
    88if ('b' == $a): 
  • trunk/wp-admin/categories.php

    r3985 r4006  
    1414 
    1515    if ( !current_user_can('manage_categories') ) 
    16         die (__('Cheatin’ uh?')); 
     16        wp_die(__('Cheatin’ uh?')); 
    1717 
    1818    wp_insert_category($_POST); 
     
    2626 
    2727    if ( !current_user_can('manage_categories') ) 
    28         die (__('Cheatin’ uh?')); 
     28        wp_die(__('Cheatin’ uh?')); 
    2929 
    3030    $cat_name = get_catname($cat_ID); 
     
    5757 
    5858    if ( !current_user_can('manage_categories') ) 
    59         die (__('Cheatin’ uh?')); 
     59        wp_die(__('Cheatin’ uh?')); 
    6060 
    6161    wp_update_category($_POST); 
  • trunk/wp-admin/install.php

    r3985 r4006  
    7575<?php 
    7676// Let's check to make sure WP isn't already installed. 
    77 if ( is_blog_installed() ) wp_die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>'); 
     77if ( is_blog_installed() ) die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>'); 
    7878 
    7979switch($step) { 
  • trunk/wp-admin/link-import.php

    r3985 r4006  
    1717        include_once('admin-header.php'); 
    1818        if ( !current_user_can('manage_links') ) 
    19             die (__("Cheatin&#8217; uh?")); 
     19            wp_die(__('Cheatin&#8217; uh?')); 
    2020 
    2121        $opmltype = 'blogrolling'; // default. 
     
    6969                include_once('admin-header.php'); 
    7070                if ( !current_user_can('manage_links') ) 
    71                     die (__("Cheatin' uh ?")); 
     71                    wp_die(__('Cheatin&#8217; uh?')); 
    7272?> 
    7373<div class="wrap"> 
  • trunk/wp-admin/link.php

    r3985 r4006  
    1919        // check the current user's level first. 
    2020        if (!current_user_can('manage_links')) 
    21             wp_die(__("Cheatin' uh ?")); 
     21            wp_die(__('Cheatin&#8217; uh?')); 
    2222 
    2323        //for each link id (in $linkcheck[]) change category to selected value 
     
    4343        // check the current user's level first. 
    4444        if (!current_user_can('manage_links')) 
    45             wp_die(__("Cheatin' uh ?")); 
     45            wp_die(__('Cheatin&#8217; uh?')); 
    4646 
    4747        //for each link id (in $linkcheck[]) change category to selected value 
     
    8080 
    8181        if (!current_user_can('manage_links')) 
    82             wp_die(__("Cheatin' uh ?")); 
     82            wp_die(__('Cheatin&#8217; uh?')); 
    8383 
    8484        wp_delete_link($link_id); 
  • trunk/wp-admin/options.php

    r3946 r4006  
    99 
    1010if ( !current_user_can('manage_options') ) 
    11     die ( __('Cheatin&#8217; uh?') ); 
     11    wp_die(__('Cheatin&#8217; uh?')); 
    1212 
    1313switch($action) { 
  • trunk/wp-admin/sidebar.php

    r3981 r4006  
    55 
    66if ( ! current_user_can('edit_posts') ) 
    7     die ("Cheatin' uh ?"); 
     7    wp_die(__('Cheatin&#8217; uh?')); 
    88 
    99if ('b' == $_GET['a']) { 
  • trunk/wp-admin/update-links.php

    r3985 r4006  
    99 
    1010if ( !$link_uris ) 
    11     wp_die('No links'); 
     11    wp_die(__('No links')); 
    1212 
    1313$link_uris = urlencode( join( $link_uris, "\n" ) ); 
  • trunk/wp-includes/functions.php

    r3990 r4006  
    11181118 
    11191119function wp_die($message) { 
    1120     global $wpdb; 
    1121  
    1122     if ( !$wpdb->show_errors ) 
    1123         return false; 
    11241120    header('Content-Type: text/html; charset=utf-8'); 
    11251121 
    1126     $output = <<<HEAD 
    1127     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    1128     <html xmlns="http://www.w3.org/1999/xhtml"> 
    1129     <head> 
    1130         <title>WordPress &rsaquo; Error</title> 
    1131         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    1132         <style media="screen" type="text/css"> 
    1133         <!-- 
    1134         html { 
    1135             background: #eee; 
    1136         } 
    1137         body { 
    1138             background: #fff; 
    1139             color: #000; 
    1140             font-family: Georgia, "Times New Roman", Times, serif; 
    1141             margin-left: 25%; 
    1142             margin-right: 25%; 
    1143             padding: .2em 2em; 
    1144         } 
    1145  
    1146         h1 { 
    1147             color: #006; 
    1148             font-size: 18px; 
    1149             font-weight: lighter; 
    1150         } 
    1151  
    1152         h2 { 
    1153             font-size: 16px; 
    1154         } 
    1155  
    1156         p, li, dt { 
    1157             line-height: 140%; 
    1158             padding-bottom: 2px; 
    1159         } 
    1160  
    1161         ul, ol { 
    1162             padding: 5px 5px 5px 20px; 
    1163         } 
    1164         #logo { 
    1165             margin-bottom: 2em; 
    1166         } 
    1167         --> 
    1168         </style> 
    1169     </head> 
    1170     <body> 
    1171     <h1 id="logo"><img alt="WordPress" src="../wp-admin/images/wordpress-logo.png" /></h1> 
    1172     <p>$message</p> 
    1173     </body> 
    1174     </html> 
    1175 HEAD; 
    1176  
    1177     $output = apply_filters('wp_die', $output, $message); 
    1178     echo $output; 
     1122?> 
     1123<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     1124<html xmlns="http://www.w3.org/1999/xhtml"> 
     1125<head> 
     1126    <title>WordPress &rsaquo; <?php _e('Error'); ?></title> 
     1127    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
     1128    <style media="screen" type="text/css"> 
     1129    <!-- 
     1130    html { 
     1131        background: #eee; 
     1132    } 
     1133    body { 
     1134        background: #fff; 
     1135        color: #000; 
     1136        font-family: Georgia, "Times New Roman", Times, serif; 
     1137        margin-left: 25%; 
     1138        margin-right: 25%; 
     1139        padding: .2em 2em; 
     1140    } 
     1141 
     1142    h1 { 
     1143        color: #006; 
     1144        font-size: 18px; 
     1145        font-weight: lighter; 
     1146    } 
     1147 
     1148    h2 { 
     1149        font-size: 16px; 
     1150    } 
     1151 
     1152    p, li, dt { 
     1153        line-height: 140%; 
     1154        padding-bottom: 2px; 
     1155    } 
     1156 
     1157    ul, ol { 
     1158        padding: 5px 5px 5px 20px; 
     1159    } 
     1160    #logo { 
     1161        margin-bottom: 2em; 
     1162    } 
     1163    --> 
     1164    </style> 
     1165</head> 
     1166<body> 
     1167    <h1 id="logo"><img alt="WordPress" src="<?php echo get_settings('siteurl'); ?>/wp-admin/images/wordpress-logo.png" /></h1> 
     1168    <p><?php echo $message; ?></p> 
     1169</body> 
     1170</html> 
     1171<?php 
    11791172 
    11801173    die(); 
  • trunk/wp-includes/wp-db.php

    r3517 r4006  
    304304 
    305305    function bail($message) { // Just wraps errors in a nice header and footer 
    306     if ( !$this->show_errors ) 
    307         return false; 
    308     header( 'Content-Type: text/html; charset=utf-8'); 
    309     echo <<<HEAD 
    310     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    311     <html xmlns="http://www.w3.org/1999/xhtml"> 
    312     <head> 
    313         <title>WordPress &rsaquo; Error</title> 
    314         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    315         <style media="screen" type="text/css"> 
    316         <!-- 
    317         html { 
    318             background: #eee; 
    319         } 
    320         body { 
    321             background: #fff; 
    322             color: #000; 
    323             font-family: Georgia, "Times New Roman", Times, serif; 
    324             margin-left: 25%; 
    325             margin-right: 25%; 
    326             padding: .2em 2em; 
    327         } 
    328  
    329         h1 { 
    330             color: #006; 
    331             font-size: 18px; 
    332             font-weight: lighter; 
    333         } 
    334  
    335         h2 { 
    336             font-size: 16px; 
    337         } 
    338  
    339         p, li, dt { 
    340             line-height: 140%; 
    341             padding-bottom: 2px; 
    342         } 
    343  
    344         ul, ol { 
    345             padding: 5px 5px 5px 20px; 
    346         } 
    347         #logo { 
    348             margin-bottom: 2em; 
    349         } 
    350         --> 
    351         </style> 
    352     </head> 
    353     <body> 
    354     <h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /></h1> 
    355 HEAD; 
    356     echo $message; 
    357     echo "</body></html>"; 
    358     die(); 
     306        if ( !$this->show_errors ) 
     307            return false; 
     308 
     309        wp_die($message); 
    359310    } 
    360311} 
  • trunk/wp-mail.php

    r3985 r4006  
    1212$pop3 = new POP3(); 
    1313 
    14 if (!$pop3->connect(get_settings('mailserver_url'), get_settings('mailserver_port'))) : 
    15     echo "Ooops $pop3->ERROR <br />\n"; 
    16     exit; 
    17 endif; 
     14if (!$pop3->connect(get_settings('mailserver_url'), get_settings('mailserver_port'))) 
     15    wp_die($pop3->ERROR); 
    1816 
    1917$count = $pop3->login(get_settings('mailserver_login'), get_settings('mailserver_pass'));