diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 67da85a21..2260e9f56 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -6,10 +6,10 @@ function write_post() { if ( 'page' == $_POST['post_type'] ) { if ( !current_user_can('edit_pages') ) - die(__('You are not allowed to create pages on this blog.')); + wp_die(__('You are not allowed to create pages on this blog.')); } else { if ( !current_user_can('edit_posts') ) - die(__('You are not allowed to create posts or drafts on this blog.')); + wp_die(__('You are not allowed to create posts or drafts on this blog.')); } // Rename. @@ -32,10 +32,10 @@ function write_post() { if ($_POST['post_author'] != $_POST['user_ID']) { if ( 'page' == $_POST['post_type'] ) { if ( !current_user_can('edit_others_pages') ) - die(__('You cannot create pages as this user.')); + wp_die(__('You cannot create pages as this user.')); } else { if ( !current_user_can('edit_others_posts') ) - die(__('You cannot post as this user.')); + wp_die(__('You cannot post as this user.')); } } @@ -151,10 +151,10 @@ function edit_post() { if ( 'page' == $_POST['post_type'] ) { if ( !current_user_can('edit_page', $post_ID) ) - die(__('You are not allowed to edit this page.')); + wp_die(__('You are not allowed to edit this page.')); } else { if ( !current_user_can('edit_post', $post_ID) ) - die(__('You are not allowed to edit this post.')); + wp_die(__('You are not allowed to edit this post.')); } // Rename. @@ -176,10 +176,10 @@ function edit_post() { if ($_POST['post_author'] != $_POST['user_ID']) { if ( 'page' == $_POST['post_type'] ) { if ( !current_user_can('edit_others_pages') ) - die(__('You cannot edit pages as this user.')); + wp_die(__('You cannot edit pages as this user.')); } else { if ( !current_user_can('edit_others_posts') ) - die(__('You cannot edit posts as this user.')); + wp_die(__('You cannot edit posts as this user.')); } } @@ -251,7 +251,7 @@ function edit_comment() { $comment_post_ID = (int) $_POST['comment_post_ID']; if (!current_user_can('edit_post', $comment_post_ID)) - die(__('You are not allowed to edit comments on this post, so you cannot edit this comment.')); + wp_die(__('You are not allowed to edit comments on this post, so you cannot edit this comment.')); $_POST['comment_author'] = $_POST['newcomment_author']; $_POST['comment_author_email'] = $_POST['newcomment_author_email']; @@ -530,7 +530,7 @@ function add_link() { function edit_link($link_id = '') { if (!current_user_can('manage_links')) - die(__("Cheatin' uh ?")); + wp_die(__("Cheatin' uh ?")); $_POST['link_url'] = wp_specialchars($_POST['link_url']); $_POST['link_url'] = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $_POST['link_url']) ? $_POST['link_url'] : 'http://' . $_POST['link_url']; @@ -1521,13 +1521,13 @@ function validate_file_to_edit($file, $allowed_files = '') { switch ($code) { case 1 : - 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.')); + 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.')); case 2 : - die(__('Sorry, can’t call files with their real path.')); + wp_die(__('Sorry, can’t call files with their real path.')); case 3 : - die(__('Sorry, that file cannot be edited.')); + wp_die(__('Sorry, that file cannot be edited.')); } } @@ -1844,7 +1844,7 @@ function wp_handle_upload(&$file, $overrides = false) { // Move the file to the uploads dir $new_file = $uploads['path'] . "/$filename"; if ( false === @ move_uploaded_file($file['tmp_name'], $new_file) ) - die(printf(__('The uploaded file could not be moved to %s.'), $file['path'])); + wp_die(printf(__('The uploaded file could not be moved to %s.'), $file['path'])); // Set correct file permissions $stat = stat(dirname($new_file)); diff --git a/wp-admin/admin.php b/wp-admin/admin.php index b5ea5af0c..9b6de5813 100644 --- a/wp-admin/admin.php +++ b/wp-admin/admin.php @@ -45,11 +45,11 @@ if (isset($_GET['page'])) { do_action($page_hook); } else { if ( validate_file($plugin_page) ) { - die(__('Invalid plugin page')); + wp_die(__('Invalid plugin page')); } if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page")) - die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page))); + wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page))); if (! isset($_GET['noheader'])) require_once(ABSPATH . '/wp-admin/admin-header.php'); @@ -65,11 +65,11 @@ if (isset($_GET['page'])) { $importer = $_GET['import']; if ( validate_file($importer) ) { - die(__('Invalid importer.')); + wp_die(__('Invalid importer.')); } if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) - die(__('Cannot load importer.')); + wp_die(__('Cannot load importer.')); include(ABSPATH . "wp-admin/import/$importer.php"); diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 7fa403338..63313d875 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -31,10 +31,10 @@ case 'delete': // Don't delete the default cats. if ( $cat_ID == get_option('default_category') ) - die(sprintf(__("Can't delete the %s category: this is the default one"), $cat_name)); + wp_die(sprintf(__("Can't delete the %s category: this is the default one"), $cat_name)); if ( $cat_ID == get_option('default_link_category') ) - die(sprintf(__("Can't delete the %s category: this is the default one for bookmarks"), $cat_name)); + wp_die(sprintf(__("Can't delete the %s category: this is the default one for bookmarks"), $cat_name)); wp_delete_category($cat_ID); diff --git a/wp-admin/comment.php b/wp-admin/comment.php index cca79dc2e..e09f3c05f 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -19,10 +19,10 @@ case 'editcomment': $comment = (int) $_GET['comment']; if ( ! $comment = get_comment($comment) ) - die(sprintf(__('Oops, no comment with this ID. Go back!'), 'javascript:history.go(-1)')); + wp_die(sprintf(__('Oops, no comment with this ID. Go back!'), 'javascript:history.go(-1)')); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) - die( __('You are not allowed to edit comments on this post.') ); + wp_die( __('You are not allowed to edit comments on this post.') ); $comment = get_comment_to_edit($comment); @@ -42,10 +42,10 @@ case 'mailapprovecomment': $nonce_action .= $comment; if ( ! $comment = get_comment($comment) ) - die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit.php')); + wp_die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit.php')); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) - 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.') ); + 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.') ); echo "
'.__('Are you looking for %title%? It is temporarily out of service. Please try again in a few minutes. Meanwhile, discover a better blogging tool.').'
' . addslashes(print_r($headers, 1)) . addslashes(print_r($response, 1)) . ''); + wp_die('
' . addslashes(print_r($headers, 1)) . addslashes(print_r($response, 1)) . ''); $this->import['blogs'][$_GET['blog']]['url'] = 'http://' . $optary['modify']['subdomain'] . '.blogspot.com/'; sleep(2); } else { @@ -321,7 +321,7 @@ class Blogger_Import { } $response = $this->post_blogger($posturl, $headers, $paramary); if ( $response['code'] >= 400 || strstr($response['body'], 'There are errors on this form') ) - die('
'.__('Error on form submission. Retry or reset the importer.').'
' . addslashes(print_r($response, 1))); + wp_die(''.__('Error on form submission. Retry or reset the importer.').'
' . addslashes(print_r($response, 1))); } $output .= "$blog_opt
Please tell the devs.
' . addslashes(print_r($response, 1)) ); + wp_die('Please tell the devs.
' . addslashes(print_r($response, 1)) ); } } if ( $optary['backup'] != $optary['modify'] ) { @@ -615,7 +615,7 @@ class Blogger_Import { $step = 0; } //echo "Step $step."; -//die(''.print_r($this->import,1).''.print_r($this->import,1).'do_login(); diff --git a/wp-admin/import/greymatter.php b/wp-admin/import/greymatter.php index f2b4e2de9..8f7b34a4f 100644 --- a/wp-admin/import/greymatter.php +++ b/wp-admin/import/greymatter.php @@ -87,10 +87,10 @@ class GM_Import { } if (!chdir($archivespath)) - die("Wrong path, $archivespath\ndoesn't exist\non the server"); + wp_die("Wrong path, $archivespath\ndoesn't exist\non the server"); if (!chdir($gmpath)) - die("Wrong path, $gmpath\ndoesn't exist\non the server"); + wp_die("Wrong path, $gmpath\ndoesn't exist\non the server"); $this->header(); ?> diff --git a/wp-admin/inline-uploading.php b/wp-admin/inline-uploading.php index 6dc75068f..320948204 100644 --- a/wp-admin/inline-uploading.php +++ b/wp-admin/inline-uploading.php @@ -5,7 +5,7 @@ require_once('admin.php'); header('Content-Type: text/html; charset=' . get_option('blog_charset')); if (!current_user_can('upload_files')) - die(__('You do not have permission to upload files.')); + wp_die(__('You do not have permission to upload files.')); wp_reset_vars(array('action', 'post', 'all', 'last', 'link', 'sort', 'start', 'imgtitle', 'descr', 'attachment')); @@ -22,7 +22,7 @@ case 'delete': check_admin_referer('inlineuploading'); if ( !current_user_can('edit_post', (int) $attachment) ) - die(__('You are not allowed to delete this attachment.').' ".__('Go back').''); + wp_die(__('You are not allowed to delete this attachment.').' ".__('Go back').''); wp_delete_attachment($attachment); @@ -38,7 +38,7 @@ $overrides = array('action'=>'save'); $file = wp_handle_upload($_FILES['image'], $overrides); if ( isset($file['error']) ) - die($file['error'] . '
'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'