WordPress.org

Make WordPress Core

Ticket #2914: wp_dies.diff

File wp_dies.diff, 41.3 KB (added by filosofo, 9 years ago)
  • wp-login.php

     
    9898        $user_email = $user_data->user_email; 
    9999 
    100100        if (!$user_email || $user_email != $_POST['email']) 
    101                 die(sprintf(__('Sorry, that user does not seem to exist in our database. Perhaps you have the wrong username or e-mail address? <a href="%s">Try again</a>.'), 'wp-login.php?action=lostpassword')); 
     101                wp_die(sprintf(__('Sorry, that user does not seem to exist in our database. Perhaps you have the wrong username or e-mail address? <a href="%s">Try again</a>.'), 'wp-login.php?action=lostpassword')); 
    102102 
    103103do_action('retreive_password', $user_login);  // Misspelled and deprecated. 
    104104do_action('retrieve_password', $user_login); 
     
    118118        if ($m == false) { 
    119119                 echo '<p>' . __('The e-mail could not be sent.') . "<br />\n"; 
    120120         echo  __('Possible reason: your host may have disabled the mail() function...') . "</p>"; 
    121                 die(); 
     121                wp_die(); 
    122122        } else { 
    123123                echo '<p>' .  sprintf(__("The e-mail was sent successfully to %s's e-mail address."), $user_login) . '<br />'; 
    124124                echo  "<a href='wp-login.php' title='" . __('Check your e-mail first, of course') . "'>" . __('Click here to login!') . '</a></p>'; 
    125                 die(); 
     125                wp_die(); 
    126126        } 
    127127 
    128128break; 
     
    132132        // Generate something random for a password... md5'ing current time with a rand salt 
    133133        $key = preg_replace('/a-z0-9/i', '', $_GET['key']); 
    134134        if ( empty($key) ) 
    135                 die( __('Sorry, that key does not appear to be valid.') ); 
     135                wp_die( __('Sorry, that key does not appear to be valid.') ); 
    136136        $user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_activation_key = '$key'"); 
    137137        if ( !$user ) 
    138                 die( __('Sorry, that key does not appear to be valid.') ); 
     138                wp_die( __('Sorry, that key does not appear to be valid.') ); 
    139139 
    140140        do_action('password_reset'); 
    141141 
     
    152152        if ($m == false) { 
    153153                echo '<p>' . __('The e-mail could not be sent.') . "<br />\n"; 
    154154                echo  __('Possible reason: your host may have disabled the mail() function...') . '</p>'; 
    155                 die(); 
     155                wp_die(); 
    156156        } else { 
    157157                echo '<p>' .  sprintf(__('Your new password is in the mail.'), $user_login) . '<br />'; 
    158158        echo  "<a href='wp-login.php' title='" . __('Check your e-mail first, of course') . "'>" . __('Click here to login!') . '</a></p>'; 
    159159                // send a copy of password change notification to the admin 
    160160                $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n"; 
    161161                wp_mail(get_settings('admin_email'), sprintf(__('[%s] Password Lost/Change'), get_settings('blogname')), $message); 
    162                 die(); 
     162                wp_die(); 
    163163        } 
    164164break; 
    165165 
  • wp-blog-header.php

     
    1818 
    1919endif; 
    2020 
    21 ?> 
    22  No newline at end of file 
     21?> 
  • wp-includes/wp-db.php

     
    355355HEAD; 
    356356        echo $message; 
    357357        echo "</body></html>"; 
    358         die(); 
     358        wp_die(); 
    359359        } 
    360360} 
    361361 
  • wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php

     
    7171                        fwrite($fh, "^$word\n"); 
    7272                        fclose($fh); 
    7373                } else 
    74                         die("Error opening tmp file."); 
     74                        wp_die("Error opening tmp file."); 
    7575 
    7676                $data = shell_exec($this->cmd); 
    7777                @unlink($this->tmpfile); 
  • wp-includes/comment.php

     
    181181                $dupe .= "OR comment_author_email = '$comment_author_email' "; 
    182182        $dupe .= ") AND comment_content = '$comment_content' LIMIT 1"; 
    183183        if ( $wpdb->get_var($dupe) ) 
    184                 die( __('Duplicate comment detected; it looks as though you\'ve already said that!') ); 
     184                wp_die( __('Duplicate comment detected; it looks as though you\'ve already said that!') ); 
    185185 
    186186        // Simple flood-protection 
    187187        if ( $lasttime = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author_IP = '$comment_author_IP' OR comment_author_email = '$comment_author_email' ORDER BY comment_date DESC LIMIT 1") ) { 
     
    189189                $time_newcomment  = mysql2date('U', $comment_date_gmt); 
    190190                if ( ($time_newcomment - $time_lastcomment) < 15 ) { 
    191191                        do_action('comment_flood_trigger', $time_lastcomment, $time_newcomment); 
    192                         die( __('Sorry, you can only post a new comment once every 15 seconds. Slow down cowboy.') ); 
     192                        wp_die( __('Sorry, you can only post a new comment once every 15 seconds. Slow down cowboy.') ); 
    193193                } 
    194194        } 
    195195 
  • wp-includes/class-IXR.php

     
    149149        xml_set_element_handler($this->_parser, 'tag_open', 'tag_close'); 
    150150        xml_set_character_data_handler($this->_parser, 'cdata'); 
    151151        if (!xml_parse($this->_parser, $this->message)) { 
    152             /* die(sprintf('XML error: %s at line %d', 
     152            /* wp_die(sprintf('XML error: %s at line %d', 
    153153                xml_error_string(xml_get_error_code($this->_parser)), 
    154154                xml_get_current_line_number($this->_parser))); */ 
    155155            return false; 
     
    275275        if (!$data) { 
    276276            global $HTTP_RAW_POST_DATA; 
    277277            if (!$HTTP_RAW_POST_DATA) { 
    278                die('XML-RPC server accepts POST requests only.'); 
     278               wp_die('XML-RPC server accepts POST requests only.'); 
    279279            } 
    280280            $data = $HTTP_RAW_POST_DATA; 
    281281        } 
  • wp-mail.php

     
    1717endif; 
    1818 
    1919$count = $pop3->login(get_settings('mailserver_login'), get_settings('mailserver_pass')); 
    20 if (0 == $count) die(__('There doesn&#8217;t seem to be any new mail.')); 
     20if (0 == $count) wp_die(__('There doesn&#8217;t seem to be any new mail.')); 
    2121 
    2222 
    2323for ($i=1; $i <= $count; $i++) : 
  • wp-content/themes/default/images/header-img.php

     
    44 
    55// If we don't have image processing support, redirect. 
    66if ( ! function_exists('imagecreatefromjpeg') ) 
    7         die(header("Location: kubrickheader.jpg")); 
     7        wp_die(header("Location: kubrickheader.jpg")); 
    88 
    99// Assign and validate the color values 
    1010$default = false; 
  • wp-settings.php

     
    55                return; 
    66 
    77        if ( isset($_REQUEST['GLOBALS']) ) 
    8                 die('GLOBALS overwrite attempt detected'); 
     8                wp_die('GLOBALS overwrite attempt detected'); 
    99 
    1010        // Variables that shouldn't be unset 
    1111        $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix'); 
     
    4747        $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]); 
    4848 
    4949if ( !(phpversion() >= '4.1') ) 
    50         die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' ); 
     50        wp_die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' ); 
    5151 
    5252if ( !extension_loaded('mysql') ) 
    53         die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' ); 
     53        wp_die( 'Your PHP installation appears to be missing the MySQL which is required for WordPress.' ); 
    5454 
    5555function timer_start() { 
    5656        global $timestart; 
     
    111111                $link = 'install.php'; 
    112112        else 
    113113                $link = 'wp-admin/install.php'; 
    114         die(sprintf(__("It doesn't look like you've installed WP yet. Try running <a href='%s'>install.php</a>."), $link)); 
     114        wp_die(sprintf(__("It doesn't look like you've installed WP yet. Try running <a href='%s'>install.php</a>."), $link)); 
    115115} 
    116116 
    117117require (ABSPATH . WPINC . '/formatting.php'); 
  • wp-admin/inline-uploading.php

     
    55header('Content-Type: text/html; charset=' . get_option('blog_charset')); 
    66 
    77if (!current_user_can('upload_files')) 
    8         die(__('You do not have permission to upload files.')); 
     8        wp_die(__('You do not have permission to upload files.')); 
    99 
    1010wp_reset_vars(array('action', 'post', 'all', 'last', 'link', 'sort', 'start', 'imgtitle', 'descr', 'attachment')); 
    1111 
     
    2222check_admin_referer('inlineuploading'); 
    2323 
    2424if ( !current_user_can('edit_post', (int) $attachment) ) 
    25         die(__('You are not allowed to delete this attachment.').' <a href="'.basename(__FILE__)."?post=$post&amp;all=$all&amp;action=upload\">".__('Go back').'</a>'); 
     25        wp_die(__('You are not allowed to delete this attachment.').' <a href="'.basename(__FILE__)."?post=$post&amp;all=$all&amp;action=upload\">".__('Go back').'</a>'); 
    2626 
    2727wp_delete_attachment($attachment); 
    2828 
     
    3838$file = wp_handle_upload($_FILES['image'], $overrides); 
    3939 
    4040if ( isset($file['error']) ) 
    41         die($file['error'] . '<br /><a href="' . basename(__FILE__) . '?action=upload&post=' . $post . '">'.__('Back to Image Uploading').'</a>'); 
     41        wp_die($file['error'] . '<br /><a href="' . basename(__FILE__) . '?action=upload&post=' . $post . '">'.__('Back to Image Uploading').'</a>'); 
    4242 
    4343$url = $file['url']; 
    4444$type = $file['type']; 
     
    8888} 
    8989 
    9090wp_redirect(basename(__FILE__) . "?post=$post&all=$all&action=view&start=0"); 
    91 die(); 
     91wp_die(); 
    9292 
    9393case 'upload': 
    9494 
     
    276276break; 
    277277 
    278278default: 
    279 die(__('This script was not meant to be called directly.')); 
     279wp_die(__('This script was not meant to be called directly.')); 
    280280} 
    281281 
    282282?> 
  • wp-admin/update-links.php

     
    33require_once( ABSPATH . 'wp-includes/class-snoopy.php'); 
    44 
    55if ( !get_option('use_linksupdate') ) 
    6         die(__('Feature disabled.')); 
     6        wp_die(__('Feature disabled.')); 
    77 
    88$link_uris = $wpdb->get_col("SELECT link_url FROM $wpdb->links"); 
    99 
    1010if ( !$link_uris ) 
    11         die('No links'); 
     11        wp_die('No links'); 
    1212 
    1313$link_uris = urlencode( join( $link_uris, "\n" ) ); 
    1414 
  • wp-admin/users.php

     
    128128        } 
    129129 
    130130        if ( !current_user_can('edit_users') ) 
    131                 die(__('You can&#8217;t edit users.')); 
     131                wp_die(__('You can&#8217;t edit users.')); 
    132132 
    133133        $userids = $_POST['users']; 
    134134        $update = 'promote'; 
    135135        foreach($userids as $id) { 
    136136                if ( ! current_user_can('edit_user', $id) ) 
    137                         die(__('You can&#8217;t edit that user.')); 
     137                        wp_die(__('You can&#8217;t edit that user.')); 
    138138                // The new role of the current user must also have edit_users caps 
    139139                if($id == $current_user->id && !$wp_roles->role_objects[$_POST['new_role']]->has_cap('edit_users')) { 
    140140                        $update = 'err_admin_role'; 
     
    158158        } 
    159159 
    160160        if ( !current_user_can('delete_users') ) 
    161                 die(__('You can&#8217;t delete users.')); 
     161                wp_die(__('You can&#8217;t delete users.')); 
    162162 
    163163        $userids = $_POST['users']; 
    164164        $update = 'del'; 
     
    166166 
    167167        foreach ( (array) $userids as $id) { 
    168168                if ( ! current_user_can('delete_user', $id) ) 
    169                         die(__('You can&#8217;t delete that user.')); 
     169                        wp_die(__('You can&#8217;t delete that user.')); 
    170170 
    171171                if($id == $current_user->id) { 
    172172                        $update = 'err_admin_del'; 
     
    252252        check_admin_referer('add-user'); 
    253253 
    254254        if ( ! current_user_can('create_users') ) 
    255                 die(__('You can&#8217;t create users.')); 
     255                wp_die(__('You can&#8217;t create users.')); 
    256256 
    257257        $user_id = add_user(); 
    258258        $update = 'add'; 
     
    262262                $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_POST['user_login']), true)); 
    263263                $redirect = add_query_arg('usersearch', $new_user_login, $redirect); 
    264264                wp_redirect(add_query_arg('update', $update, $redirect) . '#user-' . $user_id); 
    265                 die(); 
     265                wp_die(); 
    266266        } 
    267267 
    268268default: 
  • wp-admin/profile-update.php

     
    77check_admin_referer('update-profile_' . $user_ID); 
    88 
    99if ( !$_POST ) 
    10         die( __('No post?') ); 
     10        wp_die( __('No post?') ); 
    1111 
    1212$errors = edit_user($user_ID); 
    1313 
  • wp-admin/post.php

     
    117117        $post = & get_post($post_id); 
    118118 
    119119        if ( !current_user_can('delete_post', $post_id) ) 
    120                 die( __('You are not allowed to delete this post.') ); 
     120                wp_die( __('You are not allowed to delete this post.') ); 
    121121 
    122122        if ( $post->post_type == 'attachment' ) { 
    123123                if ( ! wp_delete_attachment($post_id) ) 
    124                         die( __('Error in deleting...') ); 
     124                        wp_die( __('Error in deleting...') ); 
    125125        } else { 
    126126                if ( !wp_delete_post($post_id) )  
    127                         die( __('Error in deleting...') ); 
     127                        wp_die( __('Error in deleting...') ); 
    128128        } 
    129129 
    130130        $sendback = wp_get_referer(); 
  • wp-admin/theme-editor.php

     
    1616 
    1717 
    1818if ( ! isset($themes[$theme]) ) 
    19         die(__('The requested theme does not exist.')); 
     19        wp_die(__('The requested theme does not exist.')); 
    2020 
    2121$allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files']); 
    2222 
     
    3636        check_admin_referer('edit-theme_' . $file . $theme); 
    3737 
    3838        if ( !current_user_can('edit_themes') ) 
    39                 die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>'); 
     39                wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>'); 
    4040 
    4141        $newcontent = stripslashes($_POST['newcontent']); 
    4242        $theme = urlencode($theme); 
     
    5757 
    5858        require_once('admin-header.php'); 
    5959        if ( !current_user_can('edit_themes') ) 
    60                 die('<p>'.__('You do not have sufficient permissions to edit themes for this blog.').'</p>'); 
     60                wp_die('<p>'.__('You do not have sufficient permissions to edit themes for this blog.').'</p>'); 
    6161 
    6262        update_recently_edited($file); 
    6363 
  • wp-admin/admin.php

     
    4545                do_action($page_hook); 
    4646        } else { 
    4747                if ( validate_file($plugin_page) ) { 
    48                         die(__('Invalid plugin page')); 
     48                        wp_die(__('Invalid plugin page')); 
    4949                } 
    5050 
    5151                if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page")) 
    52                         die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page))); 
     52                        wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page))); 
    5353 
    5454                if (! isset($_GET['noheader'])) 
    5555                        require_once(ABSPATH . '/wp-admin/admin-header.php'); 
     
    6565        $importer = $_GET['import']; 
    6666 
    6767        if ( validate_file($importer) ) { 
    68                 die(__('Invalid importer.')); 
     68                wp_die(__('Invalid importer.')); 
    6969        } 
    7070 
    7171        if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) 
    72                 die(__('Cannot load importer.')); 
     72                wp_die(__('Cannot load importer.')); 
    7373 
    7474        include(ABSPATH . "wp-admin/import/$importer.php"); 
    7575 
  • wp-admin/templates.php

     
    2525        check_admin_referer('edit-file_' . $file); 
    2626 
    2727        if ( ! current_user_can('edit_files') ) 
    28                 die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>'); 
     28                wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>'); 
    2929 
    3030        $newcontent = stripslashes($_POST['newcontent']); 
    3131        if (is_writeable($real_file)) { 
     
    5050        require_once('./admin-header.php'); 
    5151 
    5252        if ( ! current_user_can('edit_files') ) 
    53                 die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>'); 
     53                wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>'); 
    5454 
    5555        if ( strstr( $file, 'wp-config.php' ) ) 
    56         die('<p>'.__('The config file cannot be edited or viewed through the web interface. Sorry!').'</p>'); 
     56        wp_die('<p>'.__('The config file cannot be edited or viewed through the web interface. Sorry!').'</p>'); 
    5757 
    5858        update_recently_edited($file); 
    5959 
  • wp-admin/admin-functions.php

     
    66 
    77        if ( 'page' == $_POST['post_type'] ) { 
    88                if ( !current_user_can('edit_pages') ) 
    9                         die(__('You are not allowed to create pages on this blog.')); 
     9                        wp_die(__('You are not allowed to create pages on this blog.')); 
    1010        } else { 
    1111                if ( !current_user_can('edit_posts') ) 
    12                         die(__('You are not allowed to create posts or drafts on this blog.')); 
     12                        wp_die(__('You are not allowed to create posts or drafts on this blog.')); 
    1313        } 
    1414 
    1515        // Rename. 
     
    3232        if ($_POST['post_author'] != $_POST['user_ID']) { 
    3333                if ( 'page' == $_POST['post_type'] ) { 
    3434                        if ( !current_user_can('edit_others_pages') ) 
    35                                 die(__('You cannot create pages as this user.')); 
     35                                wp_die(__('You cannot create pages as this user.')); 
    3636                } else { 
    3737                        if ( !current_user_can('edit_others_posts') ) 
    38                                 die(__('You cannot post as this user.')); 
     38                                wp_die(__('You cannot post as this user.')); 
    3939 
    4040                } 
    4141        } 
     
    151151 
    152152        if ( 'page' == $_POST['post_type'] ) { 
    153153                if ( !current_user_can('edit_page', $post_ID) ) 
    154                         die(__('You are not allowed to edit this page.')); 
     154                        wp_die(__('You are not allowed to edit this page.')); 
    155155        } else { 
    156156                if ( !current_user_can('edit_post', $post_ID) ) 
    157                         die(__('You are not allowed to edit this post.')); 
     157                        wp_die(__('You are not allowed to edit this post.')); 
    158158        } 
    159159 
    160160        // Rename. 
     
    176176        if ($_POST['post_author'] != $_POST['user_ID']) { 
    177177                if ( 'page' == $_POST['post_type'] ) { 
    178178                        if ( !current_user_can('edit_others_pages') ) 
    179                                 die(__('You cannot edit pages as this user.')); 
     179                                wp_die(__('You cannot edit pages as this user.')); 
    180180                } else { 
    181181                        if ( !current_user_can('edit_others_posts') ) 
    182                                 die(__('You cannot edit posts as this user.')); 
     182                                wp_die(__('You cannot edit posts as this user.')); 
    183183 
    184184                } 
    185185        } 
     
    251251        $comment_post_ID = (int) $_POST['comment_post_ID']; 
    252252 
    253253        if (!current_user_can('edit_post', $comment_post_ID)) 
    254                 die(__('You are not allowed to edit comments on this post, so you cannot edit this comment.')); 
     254                wp_die(__('You are not allowed to edit comments on this post, so you cannot edit this comment.')); 
    255255 
    256256        $_POST['comment_author'] = $_POST['newcomment_author']; 
    257257        $_POST['comment_author_email'] = $_POST['newcomment_author_email']; 
     
    530530 
    531531function edit_link($link_id = '') { 
    532532        if (!current_user_can('manage_links')) 
    533                 die(__("Cheatin' uh ?")); 
     533                wp_die(__("Cheatin' uh ?")); 
    534534 
    535535        $_POST['link_url'] = wp_specialchars($_POST['link_url']); 
    536536        $_POST['link_url'] = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $_POST['link_url']) ? $_POST['link_url'] : 'http://' . $_POST['link_url']; 
     
    15211521 
    15221522        switch ($code) { 
    15231523                case 1 : 
    1524                         die(__('Sorry, can&#8217;t edit files with ".." in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.')); 
     1524                        wp_die(__('Sorry, can&#8217;t edit files with ".." in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.')); 
    15251525 
    15261526                case 2 : 
    1527                         die(__('Sorry, can&#8217;t call files with their real path.')); 
     1527                        wp_die(__('Sorry, can&#8217;t call files with their real path.')); 
    15281528 
    15291529                case 3 : 
    1530                         die(__('Sorry, that file cannot be edited.')); 
     1530                        wp_die(__('Sorry, that file cannot be edited.')); 
    15311531        } 
    15321532} 
    15331533 
     
    18441844        // Move the file to the uploads dir 
    18451845        $new_file = $uploads['path'] . "/$filename"; 
    18461846        if ( false === @ move_uploaded_file($file['tmp_name'], $new_file) ) 
    1847                 die(printf(__('The uploaded file could not be moved to %s.'), $file['path'])); 
     1847                wp_die(printf(__('The uploaded file could not be moved to %s.'), $file['path'])); 
    18481848 
    18491849        // Set correct file permissions 
    18501850        $stat = stat(dirname($new_file)); 
  • wp-admin/moderation.php

     
    2121        check_admin_referer('moderate-comments'); 
    2222 
    2323        if ( ! current_user_can('moderate_comments') ) 
    24         die('<p>'.__('Your level is not high enough to moderate comments.').'</p>'); 
     24        wp_die('<p>'.__('Your level is not high enough to moderate comments.').'</p>'); 
    2525 
    2626        $item_ignored = 0; 
    2727        $item_deleted = 0; 
  • wp-admin/comment.php

     
    1919        $comment = (int) $_GET['comment']; 
    2020 
    2121        if ( ! $comment = get_comment($comment) ) 
    22                 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'javascript:history.go(-1)')); 
     22                wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'javascript:history.go(-1)')); 
    2323 
    2424        if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 
    25                 die( __('You are not allowed to edit comments on this post.') ); 
     25                wp_die( __('You are not allowed to edit comments on this post.') ); 
    2626 
    2727        $comment = get_comment_to_edit($comment); 
    2828 
     
    4242        $nonce_action .= $comment; 
    4343 
    4444        if ( ! $comment = get_comment($comment) ) 
    45                 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 
     45                wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 
    4646 
    4747        if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 
    48                 die( 'confirmdeletecomment' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 
     48                wp_die( 'confirmdeletecomment' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 
    4949 
    5050        echo "<div class='wrap'>\n"; 
    5151        if ( 'spam' == $_GET['delete_type'] ) 
     
    9090        } 
    9191 
    9292        $postdata = get_post($p) or  
    93                 die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 
     93                wp_die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 
    9494 
    9595        if ( ! $comment = get_comment($comment) ) 
    96                          die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit-comments.php')); 
     96                         wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit-comments.php')); 
    9797 
    9898        if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 
    99                 die( __('You are not allowed to edit comments on this post.') ); 
     99                wp_die( __('You are not allowed to edit comments on this post.') ); 
    100100 
    101101        if ( 'spam' == $_REQUEST['delete_type'] ) 
    102102                wp_set_comment_status($comment->comment_ID, 'spam'); 
     
    123123        } 
    124124 
    125125        if ( ! $comment = get_comment($comment) ) 
    126                 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 
     126                wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 
    127127 
    128128        if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 
    129                 die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') ); 
     129                wp_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') ); 
    130130 
    131131        wp_set_comment_status($comment->comment_ID, "hold"); 
    132132 
     
    150150        } 
    151151 
    152152        if ( ! $comment = get_comment($comment) ) 
    153                 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 
     153                wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 
    154154 
    155155        if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 
    156                 die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 
     156                wp_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 
    157157 
    158158        wp_set_comment_status($comment->comment_ID, "approve"); 
    159159        if (get_settings("comments_notify") == true) { 
  • wp-admin/import/blogger.php

     
    2626        function restart() { 
    2727                delete_option('import-blogger'); 
    2828                wp_redirect("admin.php?import=blogger"); 
    29                 die(); 
     29                wp_die(); 
    3030        } 
    3131 
    3232        // Generates a string that will make the page reload in a specified interval. 
     
    160160                        else $status = "0%"; 
    161161                        echo "\t<li><a href='admin.php?import=blogger&amp;noheader=true&amp;blog={$blog['id']}'>{$blog['title']}</a> $status</li>\n"; 
    162162                } 
    163                 die("</ul>\n"); 
     163                wp_die("</ul>\n"); 
    164164        } 
    165165 
    166166        // Publishes. 
     
    180180                                $response = $this->get_blogger($url, $this->import['cookies']); 
    181181                                preg_match('#<p class="progressIndicator">.*</p>#U', $response['body'], $matches); 
    182182                                $progress = $matches[0]; 
    183                                 die($head . $progress); 
     183                                wp_die($head . $progress); 
    184184                        } else { 
    185185                                $this->import['blogs'][$_GET['blog']]['publish'][$i] = false; 
    186186                                update_option('import-blogger', $this->import); 
    187                                 die($head); 
     187                                wp_die($head); 
    188188                        } 
    189189                } else { 
    190190                        // Subsequent call. Keep checking status until Blogger reports publish complete. 
     
    196196                                        $this->set_next_step($i); 
    197197                                        $progress .= '<p>'.__('Moving on...').'</p>'; 
    198198                                } 
    199                                 die($head . $progress); 
     199                                wp_die($head . $progress); 
    200200                        } else { 
    201201                                $this->import['blogs'][$_GET['blog']]['publish'][$i] = false; 
    202202                                update_option('import-blogger', $this->import); 
    203                                 die("$head<p>" . __('Trying again...') . '</p>'); 
     203                                wp_die("$head<p>" . __('Trying again...') . '</p>'); 
    204204                        } 
    205205                } 
    206206        } 
     
    214214        // Redirects to next step 
    215215        function do_next_step() { 
    216216                wp_redirect("admin.php?import=blogger&noheader=true&blog={$_GET['blog']}"); 
    217                 die(); 
     217                wp_die(); 
    218218        } 
    219219 
    220220        // Step 0: Do Blogger login, get blogid/title pairs. 
     
    241241                        $blogsary = array(); 
    242242                        preg_match_all('#posts\.g\?blogID=(\d+)">([^<]+)</a>#U', $response['body'], $blogsary); 
    243243                        if ( ! count( $blogsary[1] < 1 ) ) 
    244                                 die(__('No blogs found for this user.')); 
     244                                wp_die(__('No blogs found for this user.')); 
    245245                        $this->import['blogs'] = array(); 
    246246                        $template = '<MainPage><br /><br /><br /><p>'.__('Are you looking for %title%? It is temporarily out of service. Please try again in a few minutes. Meanwhile, discover <a href="http://wordpress.org/">a better blogging tool</a>.').'</p><BloggerArchives><a class="archive" href="<$BlogArchiveURL$>"><$BlogArchiveName$></a><br /></BloggerArchives></MainPage><ArchivePage><Blogger><wordpresspost><$BlogItemDateTime$>|W|P|<$BlogItemAuthorNickname$>|W|P|<$BlogItemBody$>|W|P|<$BlogItemNumber$>|W|P|<$BlogItemTitle$>|W|P|<$BlogItemAuthorEmail$><BlogItemCommentsEnabled><BlogItemComments><wordpresscomment><$BlogCommentDateTime$>|W|P|<$BlogCommentAuthor$>|W|P|<$BlogCommentBody$></BlogItemComments></BlogItemCommentsEnabled></Blogger></ArchivePage>'; 
    247247                        foreach ( $blogsary[1] as $key => $id ) { 
     
    275275                        update_option('import-blogger', $this->import); 
    276276                        wp_redirect("admin.php?import=blogger&noheader=true&step=1"); 
    277277                } 
    278                 die(); 
     278                wp_die(); 
    279279        } 
    280280 
    281281        // Step 1: Select one of the blogs belonging to the user logged in. 
    282282        function select_blog() { 
    283283                if ( is_array($this->import['blogs']) ) { 
    284284                        $this->show_blogs(); 
    285                         die(); 
     285                        wp_die(); 
    286286                } else { 
    287287                        $this->restart(); 
    288288                } 
     
    306306                                                if ( $_POST['publishMode'] > 0 ) { 
    307307                                                        $response = $this->get_blogger("http://www.blogger.com/blog-publishing.g?blogID={$_GET['blog']}&publishMode=0", $headers); 
    308308                                                        if ( $response['code'] >= 400 ) 
    309                                                                 die('<h2>'.__('Failed attempt to change publish mode from FTP to BlogSpot.').'</h2><pre>' . addslashes(print_r($headers, 1)) . addslashes(print_r($response, 1)) . '</pre>'); 
     309                                                                wp_die('<h2>'.__('Failed attempt to change publish mode from FTP to BlogSpot.').'</h2><pre>' . addslashes(print_r($headers, 1)) . addslashes(print_r($response, 1)) . '</pre>'); 
    310310                                                        $this->import['blogs'][$_GET['blog']]['url'] = 'http://' . $optary['modify']['subdomain'] . '.blogspot.com/'; 
    311311                                                        sleep(2); 
    312312                                                } else { 
     
    321321                                        } 
    322322                                        $response = $this->post_blogger($posturl, $headers, $paramary); 
    323323                                        if ( $response['code'] >= 400 || strstr($response['body'], 'There are errors on this form') ) 
    324                                                 die('<p>'.__('Error on form submission. Retry or reset the importer.').'</p>' . addslashes(print_r($response, 1))); 
     324                                                wp_die('<p>'.__('Error on form submission. Retry or reset the importer.').'</p>' . addslashes(print_r($response, 1))); 
    325325                                } 
    326326                                $output .= "<del><p>$blog_opt</p></del>\n"; 
    327327                        } elseif ( is_array($this->import['blogs'][$_GET['blog']]['options']["$blog_opt"]['backup']) ) { 
     
    347347                        } 
    348348                } 
    349349                if ( $form ) 
    350                         die($output . $form); 
     350                        wp_die($output . $form); 
    351351 
    352352                $this->set_next_step(4); 
    353353                $this->do_next_step(); 
     
    364364        function get_archive_urls() { 
    365365                $bloghtml = $this->get_blogger($this->import['blogs'][$_GET['blog']]['url']); 
    366366                if (! strstr($bloghtml['body'], '<a class="archive"') ) 
    367                         die(__('Your Blogger blog did not take the new template or did not respond.')); 
     367                        wp_die(__('Your Blogger blog did not take the new template or did not respond.')); 
    368368                preg_match_all('#<a class="archive" href="([^"]*)"#', $bloghtml['body'], $archives); 
    369369                foreach ($archives[1] as $archive) { 
    370370                        $this->import['blogs'][$_GET['blog']]['archives'][$archive] = false; 
     
    520520                } 
    521521                if ( ! $did_one ) 
    522522                        $this->set_next_step(7); 
    523                 die( $this->refresher(1000) . $output ); 
     523                wp_die( $this->refresher(1000) . $output ); 
    524524        } 
    525525 
    526526        // Step 7: Restore the backed-up settings to Blogger 
     
    546546                                                $response = $this->get_blogger("http://www.blogger.com/blog-publishing.g?blogID={$_GET['blog']}&publishMode={$optary['backup']['publishMode']}", $headers); 
    547547                                                sleep(2); 
    548548                                                if ( $response['code'] >= 400 ) 
    549                                                         die('<h1>Error restoring publishMode.</h1><p>Please tell the devs.</p>' . addslashes(print_r($response, 1)) ); 
     549                                                        wp_die('<h1>Error restoring publishMode.</h1><p>Please tell the devs.</p>' . addslashes(print_r($response, 1)) ); 
    550550                                        } 
    551551                                } 
    552552                                if ( $optary['backup'] != $optary['modify'] ) { 
     
    566566                } 
    567567 
    568568                if ( $did_one ) { 
    569                         die( $this->refresher(1000) . $output ); 
     569                        wp_die( $this->refresher(1000) . $output ); 
    570570                } elseif ( $this->import['blogs'][$_GET['blog']]['options']['blog-publishing']['backup']['publishMode'] > 0 ) { 
    571571                        $this->set_next_step(9); 
    572572                } else { 
     
    615615                                $step = 0; 
    616616                        } 
    617617//echo "Step $step."; 
    618 //die('<pre>'.print_r($this->import,1).'</pre'); 
     618//wp_die('<pre>'.print_r($this->import,1).'</pre'); 
    619619                        switch ($step) { 
    620620                                case 0 : 
    621621                                        $this->do_login(); 
  • wp-admin/import/greymatter.php

     
    8787                } 
    8888 
    8989                if (!chdir($archivespath)) 
    90                         die("Wrong path, $archivespath\ndoesn't exist\non the server"); 
     90                        wp_die("Wrong path, $archivespath\ndoesn't exist\non the server"); 
    9191 
    9292                if (!chdir($gmpath)) 
    93                         die("Wrong path, $gmpath\ndoesn't exist\non the server"); 
     93                        wp_die("Wrong path, $gmpath\ndoesn't exist\non the server"); 
    9494                         
    9595                $this->header(); 
    9696?> 
  • wp-admin/menu.php

     
    118118ksort($menu); // make it all pretty 
    119119 
    120120if (! user_can_access_admin_page()) { 
    121         die( __('You do not have sufficient permissions to access this page.') ); 
     121        wp_die( __('You do not have sufficient permissions to access this page.') ); 
    122122} 
    123123 
    124124?> 
  • wp-admin/link-import.php

     
    8989                                        $file = wp_handle_upload($_FILES['userfile'], $overrides); 
    9090 
    9191                                        if ( isset($file['error']) ) 
    92                                                 die($file['error']); 
     92                                                wp_die($file['error']); 
    9393 
    9494                                        $url = $file['url']; 
    9595                                        $opml_url = $file['file']; 
  • wp-admin/upgrade.php

     
    11<?php 
    22define('WP_INSTALLING', true); 
    3 if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. Double check that you updated wp-config-sample.php with the proper database connection information and renamed it to wp-config.php."); 
     3if (!file_exists('../wp-config.php')) wp_die("There doesn't seem to be a wp-config.php file. Double check that you updated wp-config-sample.php with the proper database connection information and renamed it to wp-config.php."); 
    44require('../wp-config.php'); 
    55timer_start(); 
    66require_once(ABSPATH . '/wp-admin/upgrade-functions.php'); 
  • wp-admin/link.php

     
    1818 
    1919                // check the current user's level first. 
    2020                if (!current_user_can('manage_links')) 
    21                         die(__("Cheatin' uh ?")); 
     21                        wp_die(__("Cheatin' 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                         die(__("Cheatin' uh ?")); 
     45                        wp_die(__("Cheatin' 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                         die(__("Cheatin' uh ?")); 
     82                        wp_die(__("Cheatin' uh ?")); 
    8383 
    8484                wp_delete_link($link_id); 
    8585 
     
    9595                $title = __('Edit Bookmark'); 
    9696                include_once ('admin-header.php'); 
    9797                if (!current_user_can('manage_links')) 
    98                         die(__('You do not have sufficient permissions to edit the bookmarks for this blog.')); 
     98                        wp_die(__('You do not have sufficient permissions to edit the bookmarks for this blog.')); 
    9999 
    100100                $link_id = (int) $_GET['link_id']; 
    101101 
    102102                if (!$link = get_link_to_edit($link_id)) 
    103                         die(__('Link not found.')); 
     103                        wp_die(__('Link not found.')); 
    104104 
    105105                include ('edit-link-form.php'); 
    106106                break; 
  • wp-admin/setup-config.php

     
    22define('WP_INSTALLING', true); 
    33 
    44if (!file_exists('../wp-config-sample.php')) 
    5     die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.'); 
     5    wp_die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.'); 
    66 
    77$configFile = file('../wp-config-sample.php'); 
    88 
    9 if (!is_writable('../')) die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually."); 
     9if (!is_writable('../')) wp_die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually."); 
    1010 
    1111 
    1212if (isset($_GET['step'])) 
     
    7878<?php 
    7979// Check if wp-config.php has been created 
    8080if (file_exists('../wp-config.php')) 
    81         die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p></body></html>"); 
     81        wp_die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p></body></html>"); 
    8282 
    8383switch($step) { 
    8484        case 0: 
  • wp-admin/link-manager.php

     
    2222include_once ("./admin-header.php"); 
    2323 
    2424if (!current_user_can('manage_links')) 
    25         die(__("You do not have sufficient permissions to edit the bookmarks for this blog.")); 
     25        wp_die(__("You do not have sufficient permissions to edit the bookmarks for this blog.")); 
    2626 
    2727switch ($order_by) { 
    2828        case 'order_id' : 
  • wp-admin/install.php

     
    11<?php 
    22define('WP_INSTALLING', true); 
    33if (!file_exists('../wp-config.php'))  
    4     die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file."); 
     4    wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file."); 
    55 
    66require_once('../wp-config.php'); 
    77require_once('./upgrade-functions.php'); 
     
    7474<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1> 
    7575<?php 
    7676// Let's check to make sure WP isn't already installed. 
    77 if ( 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>'); 
     77if ( 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>'); 
    7878 
    7979switch($step) { 
    8080 
  • wp-admin/page.php

     
    110110        $page = & get_post($page_id); 
    111111 
    112112        if ( !current_user_can('delete_page', $page_id) ) 
    113                 die( __('You are not allowed to delete this page.') ); 
     113                wp_die( __('You are not allowed to delete this page.') ); 
    114114 
    115115        if ( $page->post_type == 'attachment' ) { 
    116116                if ( ! wp_delete_attachment($page_id) ) 
    117                         die( __('Error in deleting...') ); 
     117                        wp_die( __('Error in deleting...') ); 
    118118        } else { 
    119119                if ( !wp_delete_post($page_id) )  
    120                         die( __('Error in deleting...') ); 
     120                        wp_die( __('Error in deleting...') ); 
    121121        } 
    122122 
    123123        $sendback = wp_get_referer(); 
  • wp-admin/plugin-editor.php

     
    2323        check_admin_referer('edit-plugin_' . $file); 
    2424 
    2525        if ( !current_user_can('edit_plugins') ) 
    26                 die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>'); 
     26                wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>'); 
    2727 
    2828        $newcontent = stripslashes($_POST['newcontent']); 
    2929        if (is_writeable($real_file)) { 
     
    4343 
    4444        require_once('admin-header.php'); 
    4545        if ( !current_user_can('edit_plugins') ) 
    46                 die('<p>'.__('You do not have sufficient permissions to edit plugins for this blog.').'</p>'); 
     46                wp_die('<p>'.__('You do not have sufficient permissions to edit plugins for this blog.').'</p>'); 
    4747 
    4848        update_recently_edited("wp-content/plugins/$file"); 
    4949 
  • wp-admin/categories.php

     
    3131 
    3232        // Don't delete the default cats. 
    3333    if ( $cat_ID == get_option('default_category') ) 
    34                 die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one"), $cat_name)); 
     34                wp_die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one"), $cat_name)); 
    3535 
    3636    if ( $cat_ID == get_option('default_link_category') ) 
    37                 die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one for bookmarks"), $cat_name)); 
     37                wp_die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one for bookmarks"), $cat_name)); 
    3838 
    3939        wp_delete_category($cat_ID); 
    4040