Ticket #4332: 4332.diff
File 4332.diff, 2.0 KB (added by , 9 years ago) |
---|
-
src/wp-comments-post.php
112 112 } 113 113 } else { 114 114 if ( get_option( 'comment_registration' ) || 'private' == $status ) { 115 wp_die( __( 'Sorry, you must be logged in to post a comment.' ), 403 ); 115 wp_die( 116 '<p>' . __( 'Sorry, you must be logged in to post a comment.' ) . '</p>' . 117 '<a href"javascript:history.back()">Back</a>', 118 403 119 ); 116 120 } 117 121 } 118 122 … … 120 124 121 125 if ( get_option('require_name_email') && !$user->exists() ) { 122 126 if ( 6 > strlen( $comment_author_email ) || '' == $comment_author ) { 123 wp_die( __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), 200 ); 127 wp_die( 128 '<p>' . __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ) . '</p>' . 129 '<a href="javascript:history.back()">Back</a>', 130 200 131 ); 124 132 } elseif ( ! is_email( $comment_author_email ) ) { 125 wp_die( __( '<strong>ERROR</strong>: please enter a valid email address.' ), 200 ); 133 wp_die( 134 '<p>' . __( '<strong>ERROR</strong>: please enter a valid email address.' ) . '</p>' . 135 '<a href="javascript:history.back()">Back</a>', 136 200 137 ); 126 138 } 127 139 } 128 140 129 141 if ( '' == $comment_content ) { 130 wp_die( __( '<strong>ERROR</strong>: please type a comment.' ), 200 ); 142 wp_die( 143 '<p>' . __( '<strong>ERROR</strong>: please type a comment.' ) . '</p>' . 144 '<a href="javascript:history.back()">Back</a>', 145 200 146 ); 131 147 } 132 148 133 149 $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0; … … 136 152 137 153 $comment_id = wp_new_comment( $commentdata ); 138 154 if ( ! $comment_id ) { 139 wp_die( __( "<strong>ERROR</strong>: The comment could not be saved. Please try again later." ) ); 155 wp_die( 156 '<p>' . __( "<strong>ERROR</strong>: The comment could not be saved. Please try again later." ) . '</p>' . 157 '<a href="javascript:history.back()">Back</a>' 158 ); 140 159 } 141 160 142 161 $comment = get_comment( $comment_id );