Ticket #2902: wp_die.2.diff

File wp_die.2.diff, 7.1 kB (added by Sewar, 2 years ago)
  • Sewar/PHP/WordPress/SVN/wp-admin/bookmarklet.php

    old new  
    33require_once('admin.php'); 
    44 
    55if ( ! current_user_can('edit_posts') ) 
    6         die ("Cheatin' uh?"); 
     6        wp_die(__('Cheatin’ uh?')); 
    77 
    88if ('b' == $a): 
    99?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  • Sewar/PHP/WordPress/SVN/wp-admin/categories.php

    old new  
    1313        check_admin_referer('add-category'); 
    1414 
    1515        if ( !current_user_can('manage_categories') ) 
    16                 die (__('Cheatin&#8217; uh?')); 
     16                wp_die(__('Cheatin&#8217; uh?')); 
    1717 
    1818        wp_insert_category($_POST); 
    1919 
     
    2525        check_admin_referer('delete-category_' .  $cat_ID); 
    2626 
    2727        if ( !current_user_can('manage_categories') ) 
    28                 die (__('Cheatin&#8217; uh?')); 
     28                wp_die(__('Cheatin&#8217; uh?')); 
    2929 
    3030        $cat_name = get_catname($cat_ID); 
    3131 
     
    5656        check_admin_referer('update-category_' . $cat_ID); 
    5757 
    5858        if ( !current_user_can('manage_categories') ) 
    59                 die (__('Cheatin&#8217; uh?')); 
     59                wp_die(__('Cheatin&#8217; uh?')); 
    6060 
    6161        wp_update_category($_POST); 
    6262 
  • Sewar/PHP/WordPress/SVN/wp-admin/link-import.php

    old new  
    1616    { 
    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. 
    2222?> 
     
    6868 
    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"> 
    7474 
  • Sewar/PHP/WordPress/SVN/wp-admin/link.php

    old new  
    1818 
    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 
    2424                if (count($linkcheck) == 0) { 
     
    4242 
    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 
    4848                if (count($linkcheck) == 0) { 
     
    7979                check_admin_referer('delete-bookmark_' . $link_id); 
    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); 
    8585 
  • Sewar/PHP/WordPress/SVN/wp-admin/options.php

    old new  
    88wp_reset_vars(array('action')); 
    99 
    1010if ( !current_user_can('manage_options') ) 
    11         die ( __('Cheatin&#8217; uh?') ); 
     11        wp_die(__('Cheatin&#8217; uh?')); 
    1212 
    1313switch($action) { 
    1414 
  • Sewar/PHP/WordPress/SVN/wp-admin/sidebar.php

    old new  
    44require_once('admin.php'); 
    55 
    66if ( ! current_user_can('edit_posts') ) 
    7         die ("Cheatin' uh ?"); 
     7        wp_die(__('Cheatin&#8217; uh?')); 
    88 
    99if ('b' == $_GET['a']) { 
    1010 
  • Sewar/PHP/WordPress/SVN/wp-admin/update-links.php

    old new  
    88$link_uris = $wpdb->get_col("SELECT link_url FROM $wpdb->links"); 
    99 
    1010if ( !$link_uris ) 
    11         wp_die('No links'); 
     11        wp_die(__('No links')); 
    1212 
    1313$link_uris = urlencode( join( $link_uris, "\n" ) ); 
    1414 
  • Sewar/PHP/WordPress/SVN/wp-includes/functions.php

    old new  
    11171117} 
    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                
     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       
    11451141 
    1146                h1 { 
    1147                        color: #006; 
    1148                        font-size: 18px; 
    1149                        font-weight: lighter; 
    1150                
     1142        h1 { 
     1143                color: #006; 
     1144                font-size: 18px; 
     1145                font-weight: lighter; 
     1146       
    11511147 
    1152                h2 { 
    1153                        font-size: 16px; 
    1154                
     1148        h2 { 
     1149                font-size: 16px; 
     1150       
    11551151 
    1156                p, li, dt { 
    1157                        line-height: 140%; 
    1158                        padding-bottom: 2px; 
    1159                
     1152        p, li, dt { 
     1153                line-height: 140%; 
     1154                padding-bottom: 2px; 
     1155       
    11601156 
    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; 
     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 ABSPATH; ?>/wp-admin/images/wordpress-logo.png" /></h1> 
     1168        <p><?php echo $message; ?></p> 
     1169</body> 
     1170</html> 
     1171<?php 
    11761172 
    1177         $output = apply_filters('wp_die', $output, $message); 
    1178         echo $output; 
    1179  
    11801173        die(); 
    11811174} 
    11821175