Ticket #2914: wp_dies.diff
| File wp_dies.diff, 41.3 KB (added by , 19 years ago) |
|---|
-
wp-login.php
98 98 $user_email = $user_data->user_email; 99 99 100 100 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')); 102 102 103 103 do_action('retreive_password', $user_login); // Misspelled and deprecated. 104 104 do_action('retrieve_password', $user_login); … … 118 118 if ($m == false) { 119 119 echo '<p>' . __('The e-mail could not be sent.') . "<br />\n"; 120 120 echo __('Possible reason: your host may have disabled the mail() function...') . "</p>"; 121 die();121 wp_die(); 122 122 } else { 123 123 echo '<p>' . sprintf(__("The e-mail was sent successfully to %s's e-mail address."), $user_login) . '<br />'; 124 124 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(); 126 126 } 127 127 128 128 break; … … 132 132 // Generate something random for a password... md5'ing current time with a rand salt 133 133 $key = preg_replace('/a-z0-9/i', '', $_GET['key']); 134 134 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.') ); 136 136 $user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_activation_key = '$key'"); 137 137 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.') ); 139 139 140 140 do_action('password_reset'); 141 141 … … 152 152 if ($m == false) { 153 153 echo '<p>' . __('The e-mail could not be sent.') . "<br />\n"; 154 154 echo __('Possible reason: your host may have disabled the mail() function...') . '</p>'; 155 die();155 wp_die(); 156 156 } else { 157 157 echo '<p>' . sprintf(__('Your new password is in the mail.'), $user_login) . '<br />'; 158 158 echo "<a href='wp-login.php' title='" . __('Check your e-mail first, of course') . "'>" . __('Click here to login!') . '</a></p>'; 159 159 // send a copy of password change notification to the admin 160 160 $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n"; 161 161 wp_mail(get_settings('admin_email'), sprintf(__('[%s] Password Lost/Change'), get_settings('blogname')), $message); 162 die();162 wp_die(); 163 163 } 164 164 break; 165 165 -
wp-blog-header.php
18 18 19 19 endif; 20 20 21 ?> 22 No newline at end of file 21 ?> -
wp-includes/wp-db.php
355 355 HEAD; 356 356 echo $message; 357 357 echo "</body></html>"; 358 die();358 wp_die(); 359 359 } 360 360 } 361 361 -
wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php
71 71 fwrite($fh, "^$word\n"); 72 72 fclose($fh); 73 73 } else 74 die("Error opening tmp file.");74 wp_die("Error opening tmp file."); 75 75 76 76 $data = shell_exec($this->cmd); 77 77 @unlink($this->tmpfile); -
wp-includes/comment.php
181 181 $dupe .= "OR comment_author_email = '$comment_author_email' "; 182 182 $dupe .= ") AND comment_content = '$comment_content' LIMIT 1"; 183 183 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!') ); 185 185 186 186 // Simple flood-protection 187 187 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") ) { … … 189 189 $time_newcomment = mysql2date('U', $comment_date_gmt); 190 190 if ( ($time_newcomment - $time_lastcomment) < 15 ) { 191 191 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.') ); 193 193 } 194 194 } 195 195 -
wp-includes/class-IXR.php
149 149 xml_set_element_handler($this->_parser, 'tag_open', 'tag_close'); 150 150 xml_set_character_data_handler($this->_parser, 'cdata'); 151 151 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', 153 153 xml_error_string(xml_get_error_code($this->_parser)), 154 154 xml_get_current_line_number($this->_parser))); */ 155 155 return false; … … 275 275 if (!$data) { 276 276 global $HTTP_RAW_POST_DATA; 277 277 if (!$HTTP_RAW_POST_DATA) { 278 die('XML-RPC server accepts POST requests only.');278 wp_die('XML-RPC server accepts POST requests only.'); 279 279 } 280 280 $data = $HTTP_RAW_POST_DATA; 281 281 } -
wp-mail.php
17 17 endif; 18 18 19 19 $count = $pop3->login(get_settings('mailserver_login'), get_settings('mailserver_pass')); 20 if (0 == $count) die(__('There doesn’t seem to be any new mail.'));20 if (0 == $count) wp_die(__('There doesn’t seem to be any new mail.')); 21 21 22 22 23 23 for ($i=1; $i <= $count; $i++) : -
wp-content/themes/default/images/header-img.php
4 4 5 5 // If we don't have image processing support, redirect. 6 6 if ( ! function_exists('imagecreatefromjpeg') ) 7 die(header("Location: kubrickheader.jpg"));7 wp_die(header("Location: kubrickheader.jpg")); 8 8 9 9 // Assign and validate the color values 10 10 $default = false; -
wp-settings.php
5 5 return; 6 6 7 7 if ( isset($_REQUEST['GLOBALS']) ) 8 die('GLOBALS overwrite attempt detected');8 wp_die('GLOBALS overwrite attempt detected'); 9 9 10 10 // Variables that shouldn't be unset 11 11 $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix'); … … 47 47 $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]); 48 48 49 49 if ( !(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' ); 51 51 52 52 if ( !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.' ); 54 54 55 55 function timer_start() { 56 56 global $timestart; … … 111 111 $link = 'install.php'; 112 112 else 113 113 $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)); 115 115 } 116 116 117 117 require (ABSPATH . WPINC . '/formatting.php'); -
wp-admin/inline-uploading.php
5 5 header('Content-Type: text/html; charset=' . get_option('blog_charset')); 6 6 7 7 if (!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.')); 9 9 10 10 wp_reset_vars(array('action', 'post', 'all', 'last', 'link', 'sort', 'start', 'imgtitle', 'descr', 'attachment')); 11 11 … … 22 22 check_admin_referer('inlineuploading'); 23 23 24 24 if ( !current_user_can('edit_post', (int) $attachment) ) 25 die(__('You are not allowed to delete this attachment.').' <a href="'.basename(__FILE__)."?post=$post&all=$all&action=upload\">".__('Go back').'</a>');25 wp_die(__('You are not allowed to delete this attachment.').' <a href="'.basename(__FILE__)."?post=$post&all=$all&action=upload\">".__('Go back').'</a>'); 26 26 27 27 wp_delete_attachment($attachment); 28 28 … … 38 38 $file = wp_handle_upload($_FILES['image'], $overrides); 39 39 40 40 if ( 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>'); 42 42 43 43 $url = $file['url']; 44 44 $type = $file['type']; … … 88 88 } 89 89 90 90 wp_redirect(basename(__FILE__) . "?post=$post&all=$all&action=view&start=0"); 91 die();91 wp_die(); 92 92 93 93 case 'upload': 94 94 … … 276 276 break; 277 277 278 278 default: 279 die(__('This script was not meant to be called directly.'));279 wp_die(__('This script was not meant to be called directly.')); 280 280 } 281 281 282 282 ?> -
wp-admin/update-links.php
3 3 require_once( ABSPATH . 'wp-includes/class-snoopy.php'); 4 4 5 5 if ( !get_option('use_linksupdate') ) 6 die(__('Feature disabled.'));6 wp_die(__('Feature disabled.')); 7 7 8 8 $link_uris = $wpdb->get_col("SELECT link_url FROM $wpdb->links"); 9 9 10 10 if ( !$link_uris ) 11 die('No links');11 wp_die('No links'); 12 12 13 13 $link_uris = urlencode( join( $link_uris, "\n" ) ); 14 14 -
wp-admin/users.php
128 128 } 129 129 130 130 if ( !current_user_can('edit_users') ) 131 die(__('You can’t edit users.'));131 wp_die(__('You can’t edit users.')); 132 132 133 133 $userids = $_POST['users']; 134 134 $update = 'promote'; 135 135 foreach($userids as $id) { 136 136 if ( ! current_user_can('edit_user', $id) ) 137 die(__('You can’t edit that user.'));137 wp_die(__('You can’t edit that user.')); 138 138 // The new role of the current user must also have edit_users caps 139 139 if($id == $current_user->id && !$wp_roles->role_objects[$_POST['new_role']]->has_cap('edit_users')) { 140 140 $update = 'err_admin_role'; … … 158 158 } 159 159 160 160 if ( !current_user_can('delete_users') ) 161 die(__('You can’t delete users.'));161 wp_die(__('You can’t delete users.')); 162 162 163 163 $userids = $_POST['users']; 164 164 $update = 'del'; … … 166 166 167 167 foreach ( (array) $userids as $id) { 168 168 if ( ! current_user_can('delete_user', $id) ) 169 die(__('You can’t delete that user.'));169 wp_die(__('You can’t delete that user.')); 170 170 171 171 if($id == $current_user->id) { 172 172 $update = 'err_admin_del'; … … 252 252 check_admin_referer('add-user'); 253 253 254 254 if ( ! current_user_can('create_users') ) 255 die(__('You can’t create users.'));255 wp_die(__('You can’t create users.')); 256 256 257 257 $user_id = add_user(); 258 258 $update = 'add'; … … 262 262 $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_POST['user_login']), true)); 263 263 $redirect = add_query_arg('usersearch', $new_user_login, $redirect); 264 264 wp_redirect(add_query_arg('update', $update, $redirect) . '#user-' . $user_id); 265 die();265 wp_die(); 266 266 } 267 267 268 268 default: -
wp-admin/profile-update.php
7 7 check_admin_referer('update-profile_' . $user_ID); 8 8 9 9 if ( !$_POST ) 10 die( __('No post?') );10 wp_die( __('No post?') ); 11 11 12 12 $errors = edit_user($user_ID); 13 13 -
wp-admin/post.php
117 117 $post = & get_post($post_id); 118 118 119 119 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.') ); 121 121 122 122 if ( $post->post_type == 'attachment' ) { 123 123 if ( ! wp_delete_attachment($post_id) ) 124 die( __('Error in deleting...') );124 wp_die( __('Error in deleting...') ); 125 125 } else { 126 126 if ( !wp_delete_post($post_id) ) 127 die( __('Error in deleting...') );127 wp_die( __('Error in deleting...') ); 128 128 } 129 129 130 130 $sendback = wp_get_referer(); -
wp-admin/theme-editor.php
16 16 17 17 18 18 if ( ! isset($themes[$theme]) ) 19 die(__('The requested theme does not exist.'));19 wp_die(__('The requested theme does not exist.')); 20 20 21 21 $allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files']); 22 22 … … 36 36 check_admin_referer('edit-theme_' . $file . $theme); 37 37 38 38 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>'); 40 40 41 41 $newcontent = stripslashes($_POST['newcontent']); 42 42 $theme = urlencode($theme); … … 57 57 58 58 require_once('admin-header.php'); 59 59 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>'); 61 61 62 62 update_recently_edited($file); 63 63 -
wp-admin/admin.php
45 45 do_action($page_hook); 46 46 } else { 47 47 if ( validate_file($plugin_page) ) { 48 die(__('Invalid plugin page'));48 wp_die(__('Invalid plugin page')); 49 49 } 50 50 51 51 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))); 53 53 54 54 if (! isset($_GET['noheader'])) 55 55 require_once(ABSPATH . '/wp-admin/admin-header.php'); … … 65 65 $importer = $_GET['import']; 66 66 67 67 if ( validate_file($importer) ) { 68 die(__('Invalid importer.'));68 wp_die(__('Invalid importer.')); 69 69 } 70 70 71 71 if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) 72 die(__('Cannot load importer.'));72 wp_die(__('Cannot load importer.')); 73 73 74 74 include(ABSPATH . "wp-admin/import/$importer.php"); 75 75 -
wp-admin/templates.php
25 25 check_admin_referer('edit-file_' . $file); 26 26 27 27 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>'); 29 29 30 30 $newcontent = stripslashes($_POST['newcontent']); 31 31 if (is_writeable($real_file)) { … … 50 50 require_once('./admin-header.php'); 51 51 52 52 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>'); 54 54 55 55 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>'); 57 57 58 58 update_recently_edited($file); 59 59 -
wp-admin/admin-functions.php
6 6 7 7 if ( 'page' == $_POST['post_type'] ) { 8 8 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.')); 10 10 } else { 11 11 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.')); 13 13 } 14 14 15 15 // Rename. … … 32 32 if ($_POST['post_author'] != $_POST['user_ID']) { 33 33 if ( 'page' == $_POST['post_type'] ) { 34 34 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.')); 36 36 } else { 37 37 if ( !current_user_can('edit_others_posts') ) 38 die(__('You cannot post as this user.'));38 wp_die(__('You cannot post as this user.')); 39 39 40 40 } 41 41 } … … 151 151 152 152 if ( 'page' == $_POST['post_type'] ) { 153 153 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.')); 155 155 } else { 156 156 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.')); 158 158 } 159 159 160 160 // Rename. … … 176 176 if ($_POST['post_author'] != $_POST['user_ID']) { 177 177 if ( 'page' == $_POST['post_type'] ) { 178 178 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.')); 180 180 } else { 181 181 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.')); 183 183 184 184 } 185 185 } … … 251 251 $comment_post_ID = (int) $_POST['comment_post_ID']; 252 252 253 253 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.')); 255 255 256 256 $_POST['comment_author'] = $_POST['newcomment_author']; 257 257 $_POST['comment_author_email'] = $_POST['newcomment_author_email']; … … 530 530 531 531 function edit_link($link_id = '') { 532 532 if (!current_user_can('manage_links')) 533 die(__("Cheatin' uh ?"));533 wp_die(__("Cheatin' uh ?")); 534 534 535 535 $_POST['link_url'] = wp_specialchars($_POST['link_url']); 536 536 $_POST['link_url'] = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $_POST['link_url']) ? $_POST['link_url'] : 'http://' . $_POST['link_url']; … … 1521 1521 1522 1522 switch ($code) { 1523 1523 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.')); 1525 1525 1526 1526 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.')); 1528 1528 1529 1529 case 3 : 1530 die(__('Sorry, that file cannot be edited.'));1530 wp_die(__('Sorry, that file cannot be edited.')); 1531 1531 } 1532 1532 } 1533 1533 … … 1844 1844 // Move the file to the uploads dir 1845 1845 $new_file = $uploads['path'] . "/$filename"; 1846 1846 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'])); 1848 1848 1849 1849 // Set correct file permissions 1850 1850 $stat = stat(dirname($new_file)); -
wp-admin/moderation.php
21 21 check_admin_referer('moderate-comments'); 22 22 23 23 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>'); 25 25 26 26 $item_ignored = 0; 27 27 $item_deleted = 0; -
wp-admin/comment.php
19 19 $comment = (int) $_GET['comment']; 20 20 21 21 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)')); 23 23 24 24 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.') ); 26 26 27 27 $comment = get_comment_to_edit($comment); 28 28 … … 42 42 $nonce_action .= $comment; 43 43 44 44 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')); 46 46 47 47 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.') ); 49 49 50 50 echo "<div class='wrap'>\n"; 51 51 if ( 'spam' == $_GET['delete_type'] ) … … 90 90 } 91 91 92 92 $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')); 94 94 95 95 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')); 97 97 98 98 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.') ); 100 100 101 101 if ( 'spam' == $_REQUEST['delete_type'] ) 102 102 wp_set_comment_status($comment->comment_ID, 'spam'); … … 123 123 } 124 124 125 125 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')); 127 127 128 128 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.') ); 130 130 131 131 wp_set_comment_status($comment->comment_ID, "hold"); 132 132 … … 150 150 } 151 151 152 152 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')); 154 154 155 155 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.') ); 157 157 158 158 wp_set_comment_status($comment->comment_ID, "approve"); 159 159 if (get_settings("comments_notify") == true) { -
wp-admin/import/blogger.php
26 26 function restart() { 27 27 delete_option('import-blogger'); 28 28 wp_redirect("admin.php?import=blogger"); 29 die();29 wp_die(); 30 30 } 31 31 32 32 // Generates a string that will make the page reload in a specified interval. … … 160 160 else $status = "0%"; 161 161 echo "\t<li><a href='admin.php?import=blogger&noheader=true&blog={$blog['id']}'>{$blog['title']}</a> $status</li>\n"; 162 162 } 163 die("</ul>\n");163 wp_die("</ul>\n"); 164 164 } 165 165 166 166 // Publishes. … … 180 180 $response = $this->get_blogger($url, $this->import['cookies']); 181 181 preg_match('#<p class="progressIndicator">.*</p>#U', $response['body'], $matches); 182 182 $progress = $matches[0]; 183 die($head . $progress);183 wp_die($head . $progress); 184 184 } else { 185 185 $this->import['blogs'][$_GET['blog']]['publish'][$i] = false; 186 186 update_option('import-blogger', $this->import); 187 die($head);187 wp_die($head); 188 188 } 189 189 } else { 190 190 // Subsequent call. Keep checking status until Blogger reports publish complete. … … 196 196 $this->set_next_step($i); 197 197 $progress .= '<p>'.__('Moving on...').'</p>'; 198 198 } 199 die($head . $progress);199 wp_die($head . $progress); 200 200 } else { 201 201 $this->import['blogs'][$_GET['blog']]['publish'][$i] = false; 202 202 update_option('import-blogger', $this->import); 203 die("$head<p>" . __('Trying again...') . '</p>');203 wp_die("$head<p>" . __('Trying again...') . '</p>'); 204 204 } 205 205 } 206 206 } … … 214 214 // Redirects to next step 215 215 function do_next_step() { 216 216 wp_redirect("admin.php?import=blogger&noheader=true&blog={$_GET['blog']}"); 217 die();217 wp_die(); 218 218 } 219 219 220 220 // Step 0: Do Blogger login, get blogid/title pairs. … … 241 241 $blogsary = array(); 242 242 preg_match_all('#posts\.g\?blogID=(\d+)">([^<]+)</a>#U', $response['body'], $blogsary); 243 243 if ( ! count( $blogsary[1] < 1 ) ) 244 die(__('No blogs found for this user.'));244 wp_die(__('No blogs found for this user.')); 245 245 $this->import['blogs'] = array(); 246 246 $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>'; 247 247 foreach ( $blogsary[1] as $key => $id ) { … … 275 275 update_option('import-blogger', $this->import); 276 276 wp_redirect("admin.php?import=blogger&noheader=true&step=1"); 277 277 } 278 die();278 wp_die(); 279 279 } 280 280 281 281 // Step 1: Select one of the blogs belonging to the user logged in. 282 282 function select_blog() { 283 283 if ( is_array($this->import['blogs']) ) { 284 284 $this->show_blogs(); 285 die();285 wp_die(); 286 286 } else { 287 287 $this->restart(); 288 288 } … … 306 306 if ( $_POST['publishMode'] > 0 ) { 307 307 $response = $this->get_blogger("http://www.blogger.com/blog-publishing.g?blogID={$_GET['blog']}&publishMode=0", $headers); 308 308 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>'); 310 310 $this->import['blogs'][$_GET['blog']]['url'] = 'http://' . $optary['modify']['subdomain'] . '.blogspot.com/'; 311 311 sleep(2); 312 312 } else { … … 321 321 } 322 322 $response = $this->post_blogger($posturl, $headers, $paramary); 323 323 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))); 325 325 } 326 326 $output .= "<del><p>$blog_opt</p></del>\n"; 327 327 } elseif ( is_array($this->import['blogs'][$_GET['blog']]['options']["$blog_opt"]['backup']) ) { … … 347 347 } 348 348 } 349 349 if ( $form ) 350 die($output . $form);350 wp_die($output . $form); 351 351 352 352 $this->set_next_step(4); 353 353 $this->do_next_step(); … … 364 364 function get_archive_urls() { 365 365 $bloghtml = $this->get_blogger($this->import['blogs'][$_GET['blog']]['url']); 366 366 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.')); 368 368 preg_match_all('#<a class="archive" href="([^"]*)"#', $bloghtml['body'], $archives); 369 369 foreach ($archives[1] as $archive) { 370 370 $this->import['blogs'][$_GET['blog']]['archives'][$archive] = false; … … 520 520 } 521 521 if ( ! $did_one ) 522 522 $this->set_next_step(7); 523 die( $this->refresher(1000) . $output );523 wp_die( $this->refresher(1000) . $output ); 524 524 } 525 525 526 526 // Step 7: Restore the backed-up settings to Blogger … … 546 546 $response = $this->get_blogger("http://www.blogger.com/blog-publishing.g?blogID={$_GET['blog']}&publishMode={$optary['backup']['publishMode']}", $headers); 547 547 sleep(2); 548 548 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)) ); 550 550 } 551 551 } 552 552 if ( $optary['backup'] != $optary['modify'] ) { … … 566 566 } 567 567 568 568 if ( $did_one ) { 569 die( $this->refresher(1000) . $output );569 wp_die( $this->refresher(1000) . $output ); 570 570 } elseif ( $this->import['blogs'][$_GET['blog']]['options']['blog-publishing']['backup']['publishMode'] > 0 ) { 571 571 $this->set_next_step(9); 572 572 } else { … … 615 615 $step = 0; 616 616 } 617 617 //echo "Step $step."; 618 // die('<pre>'.print_r($this->import,1).'</pre');618 //wp_die('<pre>'.print_r($this->import,1).'</pre'); 619 619 switch ($step) { 620 620 case 0 : 621 621 $this->do_login(); -
wp-admin/import/greymatter.php
87 87 } 88 88 89 89 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"); 91 91 92 92 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"); 94 94 95 95 $this->header(); 96 96 ?> -
wp-admin/menu.php
118 118 ksort($menu); // make it all pretty 119 119 120 120 if (! 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.') ); 122 122 } 123 123 124 124 ?> -
wp-admin/link-import.php
89 89 $file = wp_handle_upload($_FILES['userfile'], $overrides); 90 90 91 91 if ( isset($file['error']) ) 92 die($file['error']);92 wp_die($file['error']); 93 93 94 94 $url = $file['url']; 95 95 $opml_url = $file['file']; -
wp-admin/upgrade.php
1 1 <?php 2 2 define('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.");3 if (!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."); 4 4 require('../wp-config.php'); 5 5 timer_start(); 6 6 require_once(ABSPATH . '/wp-admin/upgrade-functions.php'); -
wp-admin/link.php
18 18 19 19 // check the current user's level first. 20 20 if (!current_user_can('manage_links')) 21 die(__("Cheatin' uh ?"));21 wp_die(__("Cheatin' uh ?")); 22 22 23 23 //for each link id (in $linkcheck[]) change category to selected value 24 24 if (count($linkcheck) == 0) { … … 42 42 43 43 // check the current user's level first. 44 44 if (!current_user_can('manage_links')) 45 die(__("Cheatin' uh ?"));45 wp_die(__("Cheatin' uh ?")); 46 46 47 47 //for each link id (in $linkcheck[]) change category to selected value 48 48 if (count($linkcheck) == 0) { … … 79 79 check_admin_referer('delete-bookmark_' . $link_id); 80 80 81 81 if (!current_user_can('manage_links')) 82 die(__("Cheatin' uh ?"));82 wp_die(__("Cheatin' uh ?")); 83 83 84 84 wp_delete_link($link_id); 85 85 … … 95 95 $title = __('Edit Bookmark'); 96 96 include_once ('admin-header.php'); 97 97 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.')); 99 99 100 100 $link_id = (int) $_GET['link_id']; 101 101 102 102 if (!$link = get_link_to_edit($link_id)) 103 die(__('Link not found.'));103 wp_die(__('Link not found.')); 104 104 105 105 include ('edit-link-form.php'); 106 106 break; -
wp-admin/setup-config.php
2 2 define('WP_INSTALLING', true); 3 3 4 4 if (!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.'); 6 6 7 7 $configFile = file('../wp-config-sample.php'); 8 8 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.");9 if (!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."); 10 10 11 11 12 12 if (isset($_GET['step'])) … … 78 78 <?php 79 79 // Check if wp-config.php has been created 80 80 if (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>"); 82 82 83 83 switch($step) { 84 84 case 0: -
wp-admin/link-manager.php
22 22 include_once ("./admin-header.php"); 23 23 24 24 if (!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.")); 26 26 27 27 switch ($order_by) { 28 28 case 'order_id' : -
wp-admin/install.php
1 1 <?php 2 2 define('WP_INSTALLING', true); 3 3 if (!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."); 5 5 6 6 require_once('../wp-config.php'); 7 7 require_once('./upgrade-functions.php'); … … 74 74 <h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1> 75 75 <?php 76 76 // 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>');77 if ( is_blog_installed() ) wp_die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>'); 78 78 79 79 switch($step) { 80 80 -
wp-admin/page.php
110 110 $page = & get_post($page_id); 111 111 112 112 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.') ); 114 114 115 115 if ( $page->post_type == 'attachment' ) { 116 116 if ( ! wp_delete_attachment($page_id) ) 117 die( __('Error in deleting...') );117 wp_die( __('Error in deleting...') ); 118 118 } else { 119 119 if ( !wp_delete_post($page_id) ) 120 die( __('Error in deleting...') );120 wp_die( __('Error in deleting...') ); 121 121 } 122 122 123 123 $sendback = wp_get_referer(); -
wp-admin/plugin-editor.php
23 23 check_admin_referer('edit-plugin_' . $file); 24 24 25 25 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>'); 27 27 28 28 $newcontent = stripslashes($_POST['newcontent']); 29 29 if (is_writeable($real_file)) { … … 43 43 44 44 require_once('admin-header.php'); 45 45 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>'); 47 47 48 48 update_recently_edited("wp-content/plugins/$file"); 49 49 -
wp-admin/categories.php
31 31 32 32 // Don't delete the default cats. 33 33 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)); 35 35 36 36 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)); 38 38 39 39 wp_delete_category($cat_ID); 40 40