Make WordPress Core

Changeset 3985


Ignore:
Timestamp:
07/05/2006 10:00:03 PM (20 years ago)
Author:
ryan
Message:

Use wp_die(). Props filosofo. fixes #2914

Location:
trunk
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r3981 r3985  
    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
    … …  
    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                }
    … …  
    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
    … …  
    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                }
    … …  
    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'];
    … …  
    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']);
    … …  
    15221522        switch ($code) {
    15231523                case 1 :
    1524                         die(__('Sorry, can’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’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’t call files with their real path.'));
     1527                        wp_die(__('Sorry, can’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}
    … …  
    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
  • trunk/wp-admin/admin.php

    r3979 r3985  
    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']))
    … …  
    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");
  • trunk/wp-admin/categories.php

    r3946 r3985  
    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);
  • trunk/wp-admin/comment.php

    r3956 r3985  
    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);
    … …  
    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";
    … …  
    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'] )
    … …  
    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");
    … …  
    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");
  • trunk/wp-admin/import/blogger.php

    r3928 r3985  
    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>';
    … …  
    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);
    … …  
    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";
    … …  
    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) {
    … …  
    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                                }
    … …  
    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 :
  • trunk/wp-admin/import/greymatter.php

    r3661 r3985  
    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();
  • trunk/wp-admin/inline-uploading.php

    r3983 r3985  
    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'));
    … …  
    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);
    … …  
    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'];
    … …  
    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
  • trunk/wp-admin/install.php

    r3749 r3985  
    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) {
  • trunk/wp-admin/link-import.php

    r3760 r3985  
    9090
    9191                                        if ( isset($file['error']) )
    92                                                 die($file['error']);
     92                                                wp_die($file['error']);
    9393
    9494                                        $url = $file['url'];
  • trunk/wp-admin/link-manager.php

    r3961 r3985  
    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) {
  • trunk/wp-admin/link.php

    r3946 r3985  
    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
    … …  
    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
    … …  
    8080
    8181                if (!current_user_can('manage_links'))
    82                         die(__("Cheatin' uh ?"));
     82                        wp_die(__("Cheatin' uh ?"));
    8383
    8484                wp_delete_link($link_id);
    … …  
    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');
  • trunk/wp-admin/menu.php

    r3947 r3985  
    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
  • trunk/wp-admin/moderation.php

    r3983 r3985  
    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;
  • trunk/wp-admin/page.php

    r3946 r3985  
    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
  • trunk/wp-admin/plugin-editor.php

    r3950 r3985  
    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']);
    … …  
    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");
  • trunk/wp-admin/post.php

    r3946 r3985  
    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
  • trunk/wp-admin/profile-update.php

    r3804 r3985  
    88
    99if ( !$_POST )
    10         die( __('No post?') );
     10        wp_die( __('No post?') );
    1111
    1212$errors = edit_user($user_ID);
  • trunk/wp-admin/templates.php

    r3949 r3985  
    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']);
    … …  
    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);
  • trunk/wp-admin/theme-editor.php

    r3949 r3985  
    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']);
    … …  
    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']);
    … …  
    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);
  • trunk/wp-admin/update-links.php

    r3917 r3985  
    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" ) );
  • trunk/wp-admin/users.php

    r3928 r3985  
    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'];
    … …  
    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')) {
    … …  
    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'];
    … …  
    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) {
    … …  
    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();
  • trunk/wp-includes/comment.php

    r3902 r3985  
    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
    … …  
    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        }
  • trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php

    r3879 r3985  
    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);
  • trunk/wp-login.php

    r3972 r3985  
    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.
    … …  
    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');
  • trunk/wp-mail.php

    r3517 r3985  
    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
  • trunk/wp-settings.php

    r3951 r3985  
    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
    … …  
    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() {
    … …  
    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
Note: See TracChangeset for help on using the changeset viewer.