Merge lp:~yoboy-leguesh/ubuntu-party/bug718065 into lp:ubuntu-party

Proposed by YoBoY
Status: Merged
Merged at revision: 6
Proposed branch: lp:~yoboy-leguesh/ubuntu-party/bug718065
Merge into: lp:ubuntu-party
Diff against target: 2688 lines (+1048/-874)
17 files modified
readme.html (+1/-1)
wp-admin/async-upload.php (+7/-0)
wp-admin/includes/post.php (+2/-0)
wp-admin/includes/template.php (+4/-4)
wp-admin/includes/update-core.php (+1/-1)
wp-admin/js/post.dev.js (+23/-14)
wp-admin/js/post.js (+1/-1)
wp-content/languages/fr_FR.po (+5/-5)
wp-content/plugins/akismet/admin.php (+70/-232)
wp-content/plugins/akismet/akismet.php (+720/-337)
wp-content/plugins/akismet/readme.txt (+9/-55)
wp-content/themes/twentyten/languages/twentyten.pot (+160/-203)
wp-includes/default-filters.php (+5/-2)
wp-includes/kses.php (+20/-13)
wp-includes/pluggable.php (+1/-1)
wp-includes/script-loader.php (+1/-1)
wp-includes/version.php (+18/-4)
To merge this branch: bzr merge lp:~yoboy-leguesh/ubuntu-party/bug718065
Reviewer Review Type Date Requested Status
Ubuntu Party WebApps Developpers Pending
Review via email: mp+50356@code.launchpad.net

Description of the change

Mise à jour vers WordPress 3.0.5

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'readme.html'
2--- readme.html 2011-01-25 15:27:25 +0000
3+++ readme.html 2011-02-18 16:29:18 +0000
4@@ -8,7 +8,7 @@
5 <body>
6 <h1 id="logo">
7 <a href="http://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" width="250" height="68" /></a>
8- <br />Version 3.0.1
9+ <br />Version 3.0.5
10
11 </h1>
12 <p style="text-align: center">Plateforme de publication personnelle.</p>
13
14=== modified file 'wp-admin/async-upload.php'
15--- wp-admin/async-upload.php 2011-01-25 15:27:25 +0000
16+++ wp-admin/async-upload.php 2011-02-18 16:29:18 +0000
17@@ -30,6 +30,13 @@
18
19 // just fetch the detail form for that attachment
20 if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) {
21+ $post = get_post( $id );
22+ if ( 'attachment' != $post->post_type )
23+ wp_die( __( 'Unknown post type.' ) );
24+ $post_type_object = get_post_type_object( 'attachment' );
25+ if ( ! current_user_can( $post_type_object->cap->edit_post, $id ) )
26+ wp_die( __( 'You are not allowed to edit this item.' ) );
27+
28 if ( 2 == $_REQUEST['fetch'] ) {
29 add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
30 echo get_media_item($id, array( 'send' => false, 'delete' => true ));
31
32=== modified file 'wp-admin/includes/post.php'
33--- wp-admin/includes/post.php 2011-01-25 15:27:25 +0000
34+++ wp-admin/includes/post.php 2011-02-18 16:29:18 +0000
35@@ -689,6 +689,8 @@
36 $mid = (int) $mid;
37
38 $meta = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
39+ if ( empty($meta) )
40+ return false;
41 if ( is_serialized_string( $meta->meta_value ) )
42 $meta->meta_value = maybe_unserialize( $meta->meta_value );
43 return $meta;
44
45=== modified file 'wp-admin/includes/template.php'
46--- wp-admin/includes/template.php 2011-01-25 15:27:25 +0000
47+++ wp-admin/includes/template.php 2011-02-18 16:29:18 +0000
48@@ -1185,16 +1185,16 @@
49 if ( ! current_user_can($post_type_object->cap->edit_post, $post->ID) )
50 return;
51
52- $title = esc_attr( get_the_title( $post->ID ) );
53+ $title = htmlspecialchars( trim( $post->post_title ), ENT_QUOTES );
54
55 echo '
56 <div class="hidden" id="inline_' . $post->ID . '">
57 <div class="post_title">' . $title . '</div>
58 <div class="post_name">' . apply_filters('editable_slug', $post->post_name) . '</div>
59 <div class="post_author">' . $post->post_author . '</div>
60- <div class="comment_status">' . $post->comment_status . '</div>
61- <div class="ping_status">' . $post->ping_status . '</div>
62- <div class="_status">' . $post->post_status . '</div>
63+ <div class="comment_status">' . esc_html( $post->comment_status ) . '</div>
64+ <div class="ping_status">' . esc_html( $post->ping_status ) . '</div>
65+ <div class="_status">' . esc_html( $post->post_status ) . '</div>
66 <div class="jj">' . mysql2date( 'd', $post->post_date, false ) . '</div>
67 <div class="mm">' . mysql2date( 'm', $post->post_date, false ) . '</div>
68 <div class="aa">' . mysql2date( 'Y', $post->post_date, false ) . '</div>
69
70=== modified file 'wp-admin/includes/update-core.php'
71--- wp-admin/includes/update-core.php 2011-01-25 15:50:12 +0000
72+++ wp-admin/includes/update-core.php 2011-02-18 16:29:18 +0000
73@@ -274,7 +274,7 @@
74 $mysql_version = $wpdb->db_version();
75 $required_php_version = '4.3';
76 $required_mysql_version = '4.1.2';
77- $wp_version = '3.0.4';
78+ $wp_version = '3.0.5';
79 $php_compat = version_compare( $php_version, $required_php_version, '>=' );
80 $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
81
82
83=== modified file 'wp-admin/js/post.dev.js'
84--- wp-admin/js/post.dev.js 2011-01-25 15:27:25 +0000
85+++ wp-admin/js/post.dev.js 2011-02-18 16:29:18 +0000
86@@ -36,30 +36,39 @@
87 },
88
89 quickClicks : function(el) {
90- var thetags = $('.the-tags', el), tagchecklist = $('.tagchecklist', el), current_tags;
91+ var thetags = $('.the-tags', el),
92+ tagchecklist = $('.tagchecklist', el),
93+ id = $(el).attr('id'),
94+ current_tags, disabled;
95
96 if ( !thetags.length )
97 return;
98
99- var disabled = thetags.attr('disabled');
100+ disabled = thetags.attr('disabled');
101
102 current_tags = thetags.val().split(',');
103 tagchecklist.empty();
104
105 $.each( current_tags, function( key, val ) {
106- var txt, button_id, id = $(el).attr('id');
107-
108- val = $.trim(val);
109- if ( !val.match(/^\s+$/) && '' != val ) {
110- button_id = id + '-check-num-' + key;
111- if ( disabled )
112- txt = '<span>' + val + '</span> ';
113- else
114- txt = '<span><a id="' + button_id + '" class="ntdelbutton">X</a>&nbsp;' + val + '</span> ';
115- tagchecklist.append(txt);
116- if ( ! disabled )
117- $( '#' + button_id ).click( function(){ tagBox.parseTags(this); });
118+ var span, xbutton;
119+
120+ val = $.trim( val );
121+
122+ if ( ! val )
123+ return;
124+
125+ // Create a new span, and ensure the text is properly escaped.
126+ span = $('<span />').text( val );
127+
128+ // If tags editing isn't disabled, create the X button.
129+ if ( ! disabled ) {
130+ xbutton = $( '<a id="' + id + '-check-num-' + key + '" class="ntdelbutton">X</a>' );
131+ xbutton.click( function(){ tagBox.parseTags(this); });
132+ span.prepend('&nbsp;').prepend( xbutton );
133 }
134+
135+ // Append the span to the tag list.
136+ tagchecklist.append( span );
137 });
138 },
139
140
141=== modified file 'wp-admin/js/post.js'
142--- wp-admin/js/post.js 2011-01-25 15:27:25 +0000
143+++ wp-admin/js/post.js 2011-02-18 16:29:18 +0000
144@@ -1,1 +1,1 @@
145-var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(b){return b.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"")},parseTags:function(e){var h=e.id,b=h.split("-check-num-")[1],d=a(e).closest(".tagsdiv"),g=d.find(".the-tags"),c=g.val().split(","),f=[];delete c[b];a.each(c,function(i,j){j=a.trim(j);if(j){f.push(j)}});g.val(this.clean(f.join(",")));this.quickClicks(d);return false},quickClicks:function(d){var f=a(".the-tags",d),e=a(".tagchecklist",d),b;if(!f.length){return}var c=f.attr("disabled");b=f.val().split(",");e.empty();a.each(b,function(i,j){var g,h,k=a(d).attr("id");j=a.trim(j);if(!j.match(/^\s+$/)&&""!=j){h=k+"-check-num-"+i;if(c){g="<span>"+j+"</span> "}else{g='<span><a id="'+h+'" class="ntdelbutton">X</a>&nbsp;'+j+"</span> "}e.append(g);if(!c){a("#"+h).click(function(){tagBox.parseTags(this)})}}})},flushTags:function(e,b,g){b=b||false;var i,c=a(".the-tags",e),h=a("input.newtag",e),d;i=b?a(b).text():h.val();tagsval=c.val();d=tagsval?tagsval+","+i:i;d=this.clean(d);d=array_unique_noempty(d.split(",")).join(",");c.val(d);this.quickClicks(e);if(!b){h.val("")}if("undefined"==typeof(g)){h.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).parent().siblings(".taghint").css("visibility","")}}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:","})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)};WPSetThumbnailID=function(c){var b=a("input[value=_thumbnail_id]","#list-table");if(b.size()>0){a("#meta\\["+b.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(c)}};WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(c){if(c=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(c)}})}})(jQuery);jQuery(document).ready(function(e){var b,a,f="";postboxes.add_postbox_toggles(pagenow);if(e("#tagsdiv-post_tag").length){tagBox.init()}else{e("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}e(".categorydiv").each(function(){var l=e(this).attr("id"),h=false,k,m,j,g,i;j=l.split("-");j.shift();g=j.join("-");i=g+"_tab";if(g=="category"){i="cats"}e("a","#"+g+"-tabs").click(function(){var n=e(this).attr("href");e(this).parent().addClass("tabs").siblings("li").removeClass("tabs");e("#"+g+"-tabs").siblings(".tabs-panel").hide();e(n).show();if("#"+g+"-all"==n){deleteUserSetting(i)}else{setUserSetting(i,"pop")}return false});if(getUserSetting(i)){e('a[href="#'+g+'-pop"]',"#"+g+"-tabs").click()}e("#new"+g).one("focus",function(){e(this).val("").removeClass("form-input-tip")});e("#"+g+"-add-submit").click(function(){e("#new"+g).focus()});k=function(){if(h){return}h=true;var n=jQuery(this),p=n.is(":checked"),o=n.val().toString();e("#in-"+g+"-"+o+", #in-"+g+"-category-"+o).attr("checked",p);h=false};catAddBefore=function(n){if(!e("#new"+g).val()){return false}n.data+="&"+e(":checked","#"+g+"checklist").serialize();return n};m=function(q,p){var o,n=e("#new"+g+"_parent");if("undefined"!=p.parsed.responses[0]&&(o=p.parsed.responses[0].supplemental.newcat_parent)){n.before(o);n.remove()}};e("#"+g+"checklist").wpList({alt:"",response:g+"-ajax-response",addBefore:catAddBefore,addAfter:m});e("#"+g+"-add-toggle").click(function(){e("#"+g+"-adder").toggleClass("wp-hidden-children");e('a[href="#'+g+'-all"]',"#"+g+"-tabs").click();e("#new"+g).focus();return false});e("#"+g+"checklist li.popular-category :checkbox, #"+g+"checklist-pop :checkbox").live("click",function(){var n=e(this),p=n.is(":checked"),o=n.val();if(o&&n.parents("#taxonomy-"+g).length){e("#in-"+g+"-"+o+", #in-popular-"+g+"-"+o).attr("checked",p)}})});if(e("#postcustom").length){e("#the-list").wpList({addAfter:function(g,h){e("table#list-table").show()},addBefore:function(g){g.data+="&post_id="+e("#post_ID").val();return g}})}if(e("#submitdiv").length){b=e("#timestamp").html();a=e("#post-visibility-display").html();function d(){var g=e("#post-visibility-select");if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false);e("#sticky-span").hide()}else{e("#sticky-span").show()}if(e("input:radio:checked",g).val()!="password"){e("#password-span").hide()}else{e("#password-span").show()}}function c(){var n,p,h,r,o="page"==pagenow||"page-new"==pagenow,q=e("#post_status"),i=e("option[value=publish]",q),g=e("#aa").val(),l=e("#mm").val(),m=e("#jj").val(),k=e("#hh").val(),j=e("#mn").val();n=new Date(g,l-1,m,k,j);p=new Date(e("#hidden_aa").val(),e("#hidden_mm").val()-1,e("#hidden_jj").val(),e("#hidden_hh").val(),e("#hidden_mn").val());h=new Date(e("#cur_aa").val(),e("#cur_mm").val()-1,e("#cur_jj").val(),e("#cur_hh").val(),e("#cur_mn").val());if(n.getFullYear()!=g||(1+n.getMonth())!=l||n.getDate()!=m||n.getMinutes()!=j){e(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{e(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(n>h&&e("#original_post_status").val()!="future"){r=postL10n.publishOnFuture;e("#publish").val(postL10n.schedule)}else{if(n<=h&&e("#original_post_status").val()!="publish"){r=postL10n.publishOn;e("#publish").val(postL10n.publish)}else{r=postL10n.publishOnPast;if(o){e("#publish").val(postL10n.updatePage)}else{e("#publish").val(postL10n.updatePost)}}}if(p.toUTCString()==n.toUTCString()){e("#timestamp").html(b)}else{e("#timestamp").html(r+" <b>"+e("option[value="+e("#mm").val()+"]","#mm").text()+" "+m+", "+g+" @ "+k+":"+j+"</b> ")}if(e("input:radio:checked","#post-visibility-select").val()=="private"){if(o){e("#publish").val(postL10n.updatePage)}else{e("#publish").val(postL10n.updatePost)}if(i.length==0){q.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{i.html(postL10n.privatelyPublished)}e("option[value=publish]",q).attr("selected",true);e(".edit-post-status","#misc-publishing-actions").hide()}else{if(e("#original_post_status").val()=="future"||e("#original_post_status").val()=="draft"){if(i.length){i.remove();q.val(e("#hidden_post_status").val())}}else{i.html(postL10n.published)}if(q.is(":hidden")){e(".edit-post-status","#misc-publishing-actions").show()}}e("#post-status-display").html(e("option:selected",q).text());if(e("option:selected",q).val()=="private"||e("option:selected",q).val()=="publish"){e("#save-post").hide()}else{e("#save-post").show();if(e("option:selected",q).val()=="pending"){e("#save-post").show().val(postL10n.savePending)}else{e("#save-post").show().val(postL10n.saveDraft)}}return true}e(".edit-visibility","#visibility").click(function(){if(e("#post-visibility-select").is(":hidden")){d();e("#post-visibility-select").slideDown("normal");e(this).hide()}return false});e(".cancel-post-visibility","#post-visibility-select").click(function(){e("#post-visibility-select").slideUp("normal");e("#visibility-radio-"+e("#hidden-post-visibility").val()).attr("checked",true);e("#post_password").val(e("#hidden_post_password").val());e("#sticky").attr("checked",e("#hidden-post-sticky").attr("checked"));e("#post-visibility-display").html(a);e(".edit-visibility","#visibility").show();c();return false});e(".save-post-visibility","#post-visibility-select").click(function(){var g=e("#post-visibility-select");g.slideUp("normal");e(".edit-visibility","#visibility").show();c();if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false)}if(true==e("#sticky").attr("checked")){f="Sticky"}else{f=""}e("#post-visibility-display").html(postL10n[e("input:radio:checked",g).val()+f]);return false});e("input:radio","#post-visibility-select").change(function(){d()});e("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(e("#timestampdiv").is(":hidden")){e("#timestampdiv").slideDown("normal");e(this).hide()}return false});e(".cancel-timestamp","#timestampdiv").click(function(){e("#timestampdiv").slideUp("normal");e("#mm").val(e("#hidden_mm").val());e("#jj").val(e("#hidden_jj").val());e("#aa").val(e("#hidden_aa").val());e("#hh").val(e("#hidden_hh").val());e("#mn").val(e("#hidden_mn").val());e("#timestampdiv").siblings("a.edit-timestamp").show();c();return false});e(".save-timestamp","#timestampdiv").click(function(){if(c()){e("#timestampdiv").slideUp("normal");e("#timestampdiv").siblings("a.edit-timestamp").show()}return false});e("#post-status-select").siblings("a.edit-post-status").click(function(){if(e("#post-status-select").is(":hidden")){e("#post-status-select").slideDown("normal");e(this).hide()}return false});e(".save-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post-status-select").siblings("a.edit-post-status").show();c();return false});e(".cancel-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post_status").val(e("#hidden_post_status").val());e("#post-status-select").siblings("a.edit-post-status").show();c();return false})}if(e("#edit-slug-box").length){editPermalink=function(g){var h,l=0,k=e("#editable-post-name"),m=k.html(),p=e("#post_name"),q=p.val(),n=e("#edit-slug-buttons"),o=n.html(),j=e("#editable-post-name-full").html();e("#view-post-btn").hide();n.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");n.children(".save").click(function(){var i=k.children("input").val();e.post(ajaxurl,{action:"sample-permalink",post_id:g,new_slug:i,new_title:e("#title").val(),samplepermalinknonce:e("#samplepermalinknonce").val()},function(r){e("#edit-slug-box").html(r);n.html(o);p.attr("value",i);makeSlugeditClickable();e("#view-post-btn").show()});return false});e(".cancel","#edit-slug-buttons").click(function(){e("#view-post-btn").show();k.html(m);n.html(o);p.attr("value",q);return false});for(h=0;h<j.length;++h){if("%"==j.charAt(h)){l++}}slug_value=(l>j.length/4)?"":j;k.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(r){var i=r.keyCode||0;if(13==i){n.children(".save").click();return false}if(27==i){n.children(".cancel").click();return false}p.attr("value",this.value)}).focus()};makeSlugeditClickable=function(){e("#editable-post-name").click(function(){e("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}if(e("#title").val()==""){e("#title").siblings("#title-prompt-text").css("visibility","")}e("#title-prompt-text").click(function(){e(this).css("visibility","hidden").siblings("#title").focus()});e("#title").blur(function(){if(this.value==""){e(this).siblings("#title-prompt-text").css("visibility","")}}).focus(function(){e(this).siblings("#title-prompt-text").css("visibility","hidden")}).keydown(function(g){e(this).siblings("#title-prompt-text").css("visibility","hidden");e(this).unbind(g)})});
146\ No newline at end of file
147+var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(b){return b.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"")},parseTags:function(e){var h=e.id,b=h.split("-check-num-")[1],d=a(e).closest(".tagsdiv"),g=d.find(".the-tags"),c=g.val().split(","),f=[];delete c[b];a.each(c,function(i,j){j=a.trim(j);if(j){f.push(j)}});g.val(this.clean(f.join(",")));this.quickClicks(d);return false},quickClicks:function(d){var g=a(".the-tags",d),e=a(".tagchecklist",d),f=a(d).attr("id"),b,c;if(!g.length){return}c=g.attr("disabled");b=g.val().split(",");e.empty();a.each(b,function(i,k){var j,h;k=a.trim(k);if(!k){return}j=a("<span />").text(k);if(!c){h=a('<a id="'+f+"-check-num-"+i+'" class="ntdelbutton">X</a>');h.click(function(){tagBox.parseTags(this)});j.prepend("&nbsp;").prepend(h)}e.append(j)})},flushTags:function(e,b,g){b=b||false;var i,c=a(".the-tags",e),h=a("input.newtag",e),d;i=b?a(b).text():h.val();tagsval=c.val();d=tagsval?tagsval+","+i:i;d=this.clean(d);d=array_unique_noempty(d.split(",")).join(",");c.val(d);this.quickClicks(e);if(!b){h.val("")}if("undefined"==typeof(g)){h.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).parent().siblings(".taghint").css("visibility","")}}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:","})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)};WPSetThumbnailID=function(c){var b=a("input[value=_thumbnail_id]","#list-table");if(b.size()>0){a("#meta\\["+b.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(c)}};WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(c){if(c=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(c)}})}})(jQuery);jQuery(document).ready(function(e){var b,a,f="";postboxes.add_postbox_toggles(pagenow);if(e("#tagsdiv-post_tag").length){tagBox.init()}else{e("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}e(".categorydiv").each(function(){var l=e(this).attr("id"),h=false,k,m,j,g,i;j=l.split("-");j.shift();g=j.join("-");i=g+"_tab";if(g=="category"){i="cats"}e("a","#"+g+"-tabs").click(function(){var n=e(this).attr("href");e(this).parent().addClass("tabs").siblings("li").removeClass("tabs");e("#"+g+"-tabs").siblings(".tabs-panel").hide();e(n).show();if("#"+g+"-all"==n){deleteUserSetting(i)}else{setUserSetting(i,"pop")}return false});if(getUserSetting(i)){e('a[href="#'+g+'-pop"]',"#"+g+"-tabs").click()}e("#new"+g).one("focus",function(){e(this).val("").removeClass("form-input-tip")});e("#"+g+"-add-submit").click(function(){e("#new"+g).focus()});k=function(){if(h){return}h=true;var n=jQuery(this),p=n.is(":checked"),o=n.val().toString();e("#in-"+g+"-"+o+", #in-"+g+"-category-"+o).attr("checked",p);h=false};catAddBefore=function(n){if(!e("#new"+g).val()){return false}n.data+="&"+e(":checked","#"+g+"checklist").serialize();return n};m=function(q,p){var o,n=e("#new"+g+"_parent");if("undefined"!=p.parsed.responses[0]&&(o=p.parsed.responses[0].supplemental.newcat_parent)){n.before(o);n.remove()}};e("#"+g+"checklist").wpList({alt:"",response:g+"-ajax-response",addBefore:catAddBefore,addAfter:m});e("#"+g+"-add-toggle").click(function(){e("#"+g+"-adder").toggleClass("wp-hidden-children");e('a[href="#'+g+'-all"]',"#"+g+"-tabs").click();e("#new"+g).focus();return false});e("#"+g+"checklist li.popular-category :checkbox, #"+g+"checklist-pop :checkbox").live("click",function(){var n=e(this),p=n.is(":checked"),o=n.val();if(o&&n.parents("#taxonomy-"+g).length){e("#in-"+g+"-"+o+", #in-popular-"+g+"-"+o).attr("checked",p)}})});if(e("#postcustom").length){e("#the-list").wpList({addAfter:function(g,h){e("table#list-table").show()},addBefore:function(g){g.data+="&post_id="+e("#post_ID").val();return g}})}if(e("#submitdiv").length){b=e("#timestamp").html();a=e("#post-visibility-display").html();function d(){var g=e("#post-visibility-select");if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false);e("#sticky-span").hide()}else{e("#sticky-span").show()}if(e("input:radio:checked",g).val()!="password"){e("#password-span").hide()}else{e("#password-span").show()}}function c(){var n,p,h,r,o="page"==pagenow||"page-new"==pagenow,q=e("#post_status"),i=e("option[value=publish]",q),g=e("#aa").val(),l=e("#mm").val(),m=e("#jj").val(),k=e("#hh").val(),j=e("#mn").val();n=new Date(g,l-1,m,k,j);p=new Date(e("#hidden_aa").val(),e("#hidden_mm").val()-1,e("#hidden_jj").val(),e("#hidden_hh").val(),e("#hidden_mn").val());h=new Date(e("#cur_aa").val(),e("#cur_mm").val()-1,e("#cur_jj").val(),e("#cur_hh").val(),e("#cur_mn").val());if(n.getFullYear()!=g||(1+n.getMonth())!=l||n.getDate()!=m||n.getMinutes()!=j){e(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{e(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(n>h&&e("#original_post_status").val()!="future"){r=postL10n.publishOnFuture;e("#publish").val(postL10n.schedule)}else{if(n<=h&&e("#original_post_status").val()!="publish"){r=postL10n.publishOn;e("#publish").val(postL10n.publish)}else{r=postL10n.publishOnPast;if(o){e("#publish").val(postL10n.updatePage)}else{e("#publish").val(postL10n.updatePost)}}}if(p.toUTCString()==n.toUTCString()){e("#timestamp").html(b)}else{e("#timestamp").html(r+" <b>"+e("option[value="+e("#mm").val()+"]","#mm").text()+" "+m+", "+g+" @ "+k+":"+j+"</b> ")}if(e("input:radio:checked","#post-visibility-select").val()=="private"){if(o){e("#publish").val(postL10n.updatePage)}else{e("#publish").val(postL10n.updatePost)}if(i.length==0){q.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{i.html(postL10n.privatelyPublished)}e("option[value=publish]",q).attr("selected",true);e(".edit-post-status","#misc-publishing-actions").hide()}else{if(e("#original_post_status").val()=="future"||e("#original_post_status").val()=="draft"){if(i.length){i.remove();q.val(e("#hidden_post_status").val())}}else{i.html(postL10n.published)}if(q.is(":hidden")){e(".edit-post-status","#misc-publishing-actions").show()}}e("#post-status-display").html(e("option:selected",q).text());if(e("option:selected",q).val()=="private"||e("option:selected",q).val()=="publish"){e("#save-post").hide()}else{e("#save-post").show();if(e("option:selected",q).val()=="pending"){e("#save-post").show().val(postL10n.savePending)}else{e("#save-post").show().val(postL10n.saveDraft)}}return true}e(".edit-visibility","#visibility").click(function(){if(e("#post-visibility-select").is(":hidden")){d();e("#post-visibility-select").slideDown("normal");e(this).hide()}return false});e(".cancel-post-visibility","#post-visibility-select").click(function(){e("#post-visibility-select").slideUp("normal");e("#visibility-radio-"+e("#hidden-post-visibility").val()).attr("checked",true);e("#post_password").val(e("#hidden_post_password").val());e("#sticky").attr("checked",e("#hidden-post-sticky").attr("checked"));e("#post-visibility-display").html(a);e(".edit-visibility","#visibility").show();c();return false});e(".save-post-visibility","#post-visibility-select").click(function(){var g=e("#post-visibility-select");g.slideUp("normal");e(".edit-visibility","#visibility").show();c();if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false)}if(true==e("#sticky").attr("checked")){f="Sticky"}else{f=""}e("#post-visibility-display").html(postL10n[e("input:radio:checked",g).val()+f]);return false});e("input:radio","#post-visibility-select").change(function(){d()});e("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(e("#timestampdiv").is(":hidden")){e("#timestampdiv").slideDown("normal");e(this).hide()}return false});e(".cancel-timestamp","#timestampdiv").click(function(){e("#timestampdiv").slideUp("normal");e("#mm").val(e("#hidden_mm").val());e("#jj").val(e("#hidden_jj").val());e("#aa").val(e("#hidden_aa").val());e("#hh").val(e("#hidden_hh").val());e("#mn").val(e("#hidden_mn").val());e("#timestampdiv").siblings("a.edit-timestamp").show();c();return false});e(".save-timestamp","#timestampdiv").click(function(){if(c()){e("#timestampdiv").slideUp("normal");e("#timestampdiv").siblings("a.edit-timestamp").show()}return false});e("#post-status-select").siblings("a.edit-post-status").click(function(){if(e("#post-status-select").is(":hidden")){e("#post-status-select").slideDown("normal");e(this).hide()}return false});e(".save-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post-status-select").siblings("a.edit-post-status").show();c();return false});e(".cancel-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post_status").val(e("#hidden_post_status").val());e("#post-status-select").siblings("a.edit-post-status").show();c();return false})}if(e("#edit-slug-box").length){editPermalink=function(g){var h,l=0,k=e("#editable-post-name"),m=k.html(),p=e("#post_name"),q=p.val(),n=e("#edit-slug-buttons"),o=n.html(),j=e("#editable-post-name-full").html();e("#view-post-btn").hide();n.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");n.children(".save").click(function(){var i=k.children("input").val();e.post(ajaxurl,{action:"sample-permalink",post_id:g,new_slug:i,new_title:e("#title").val(),samplepermalinknonce:e("#samplepermalinknonce").val()},function(r){e("#edit-slug-box").html(r);n.html(o);p.attr("value",i);makeSlugeditClickable();e("#view-post-btn").show()});return false});e(".cancel","#edit-slug-buttons").click(function(){e("#view-post-btn").show();k.html(m);n.html(o);p.attr("value",q);return false});for(h=0;h<j.length;++h){if("%"==j.charAt(h)){l++}}slug_value=(l>j.length/4)?"":j;k.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(r){var i=r.keyCode||0;if(13==i){n.children(".save").click();return false}if(27==i){n.children(".cancel").click();return false}p.attr("value",this.value)}).focus()};makeSlugeditClickable=function(){e("#editable-post-name").click(function(){e("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}if(e("#title").val()==""){e("#title").siblings("#title-prompt-text").css("visibility","")}e("#title-prompt-text").click(function(){e(this).css("visibility","hidden").siblings("#title").focus()});e("#title").blur(function(){if(this.value==""){e(this).siblings("#title-prompt-text").css("visibility","")}}).focus(function(){e(this).siblings("#title-prompt-text").css("visibility","hidden")}).keydown(function(g){e(this).siblings("#title-prompt-text").css("visibility","hidden");e(this).unbind(g)})});
148\ No newline at end of file
149
150=== modified file 'wp-content/languages/fr_FR.mo'
151Binary files wp-content/languages/fr_FR.mo 2011-01-25 15:27:25 +0000 and wp-content/languages/fr_FR.mo 2011-02-18 16:29:18 +0000 differ
152=== modified file 'wp-content/languages/fr_FR.po'
153--- wp-content/languages/fr_FR.po 2011-01-25 15:27:25 +0000
154+++ wp-content/languages/fr_FR.po 2011-02-18 16:29:18 +0000
155@@ -11,7 +11,7 @@
156 "Project-Id-Version: WordPress 3.0.1\n"
157 "Report-Msgid-Bugs-To: wp-polyglots@lists.automattic.com\n"
158 "POT-Creation-Date: 2010-07-29 21:05+0000\n"
159-"PO-Revision-Date: 2010-07-30 01:49+0100\n"
160+"PO-Revision-Date: 2011-01-18 18:48+0100\n"
161 "Last-Translator: WordPress Francophone <traduction_at_wordpress-fr.net>\n"
162 "Language-Team: WordPress Francophone <traduction@wordpress-fr.net>\n"
163 "MIME-Version: 1.0\n"
164@@ -1820,7 +1820,7 @@
165 #: wp-admin/edit-link-categories.php:200
166 #: wp-admin/edit-link-category-form.php:33
167 msgid "Add Link Category"
168-msgstr "Ajouter une catégorie de lien"
169+msgstr "Ajouter une catégorie de liens"
170
171 #: wp-admin/edit-link-categories.php:207
172 #: wp-admin/edit-link-category-form.php:72
173@@ -2164,7 +2164,7 @@
174 #: wp-admin/edit-tags.php:347
175 #, php-format
176 msgid "Tags can be selectively converted to categories using the <a href=\"%s\">tag to category converter</a>"
177-msgstr "Les mots-clefs peuvent être converties de manière sélective en catégories via le <a href=\"%s\">convertisseur mots-clefs vers catégories</a>"
178+msgstr "Les mots-clefs peuvent être convertis de manière sélective en catégories via le <a href=\"%s\">convertisseur mots-clefs vers catégories</a>"
179
180 #: wp-admin/edit.php:17
181 #: wp-admin/post-new.php:17
182@@ -3184,7 +3184,7 @@
183 #: wp-admin/includes/dashboard.php:397
184 #, php-format
185 msgid "Post submitted. <a href=\"%s\">Preview post</a> | <a href=\"%s\">Edit post</a>"
186-msgstr "Article publié. <a href=\"%s\">Afficher l&rsquo;article</a> | <a href=\"%s\">Modifier l&rsquo;article</a>"
187+msgstr "Article envoyé. <a href=\"%s\">Prévisualiser l&rsquo;article</a> | <a href=\"%s\">Modifier l&rsquo;article</a>"
188
189 #: wp-admin/includes/dashboard.php:399
190 #, php-format
191@@ -10776,7 +10776,7 @@
192 #: wp-includes/comment-template.php:1537
193 #, php-format
194 msgid "Logged in as <a href=\"%1$s\">%2$s</a>. <a href=\"%3$s\" title=\"Log out of this account\">Log out?</a>"
195-msgstr "Connecté en tant que <a href=\"%1$s\">%2$s</a>. <a href=\"%3$s\" title=\"Se déconnecter de ce compte\">Se déconnecter&nbsp;?</a></p>"
196+msgstr "Connecté en tant que <a href=\"%1$s\">%2$s</a>. <a href=\"%3$s\" title=\"Se déconnecter de ce compte\">Se déconnecter&nbsp;?</a>"
197
198 #: wp-includes/comment-template.php:1538
199 msgid "Your email address will not be published."
200
201=== modified file 'wp-content/plugins/akismet/admin.php'
202--- wp-content/plugins/akismet/admin.php 2011-01-25 15:58:41 +0000
203+++ wp-content/plugins/akismet/admin.php 2011-02-18 16:29:18 +0000
204@@ -7,11 +7,11 @@
205 global $wp_version;
206
207 // all admin functions are disabled in old versions
208- if ( !function_exists('is_multisite') && version_compare( $wp_version, '3.0', '<' ) ) {
209+ if ( version_compare( $wp_version, '3.0', '<' ) ) {
210
211 function akismet_version_warning() {
212 echo "
213- <div id='akismet-warning' class='updated fade'><p><strong>".sprintf(__('Akismet %s requires WordPress 3.0 or higher.'), AKISMET_VERSION) ."</strong> ".sprintf(__('Please <a href="%s">upgrade WordPress</a> to a current version, or <a href="%s">downgrade to version 2.4 of the Akismet plugin</a>.'), 'http://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/'). "</p></div>
214+ <div id='akismet-warning' class='updated fade'><p><strong>".sprintf(__('Akismet %s required WordPress 3.0 or higher.'), AKISMET_VERSION) ."</strong> ".sprintf(__('Please <a href="%s">upgrade WordPress</a> to a current version, or <a href="%s">downgrade to version 2.4 of the Akismet plugin</a>.'), 'http://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/'). "</p></div>
215 ";
216 }
217 add_action('admin_notices', 'akismet_version_warning');
218@@ -24,11 +24,7 @@
219 else
220 $hook = 'dashboard_page_akismet-stats-display';
221 add_action('admin_head-'.$hook, 'akismet_stats_script');
222- add_meta_box('akismet-status', __('Comment History'), 'akismet_comment_status_meta_box', 'comment', 'normal');
223- wp_register_style('akismet.css', AKISMET_PLUGIN_URL . 'akismet.css');
224- wp_enqueue_style('akismet.css');
225- wp_register_script('akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery'));
226- wp_enqueue_script('akismet.js');
227+ add_meta_box('akismet-status', __('Akismet Status'), 'akismet_comment_status_meta_box', 'comment', 'normal');
228 }
229 add_action('admin_init', 'akismet_admin_init');
230
231@@ -38,17 +34,8 @@
232 function akismet_config_page() {
233 if ( function_exists('add_submenu_page') )
234 add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 'manage_options', 'akismet-key-config', 'akismet_conf');
235-}
236-
237-function akismet_plugin_action_links( $links, $file ) {
238- if ( $file == plugin_basename( dirname(__FILE__).'/akismet.php' ) ) {
239- $links[] = '<a href="plugins.php?page=akismet-key-config">'.__('Settings').'</a>';
240- }
241-
242- return $links;
243-}
244-
245-add_filter( 'plugin_action_links', 'akismet_plugin_action_links', 10, 2 );
246+
247+}
248
249 function akismet_conf() {
250 global $akismet_nonce, $wpcom_api_key;
251@@ -59,15 +46,11 @@
252
253 check_admin_referer( $akismet_nonce );
254 $key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] );
255- $home_url = parse_url( get_bloginfo('url') );
256
257 if ( empty($key) ) {
258 $key_status = 'empty';
259 $ms[] = 'new_key_empty';
260 delete_option('wordpress_api_key');
261- } elseif ( empty($home_url['host']) ) {
262- $key_status = 'empty';
263- $ms[] = 'bad_home_url';
264 } else {
265 $key_status = akismet_verify_key( $key );
266 }
267@@ -85,12 +68,6 @@
268 update_option( 'akismet_discard_month', 'true' );
269 else
270 update_option( 'akismet_discard_month', 'false' );
271-
272- if ( isset( $_POST['akismet_show_user_comments_approved'] ) )
273- update_option( 'akismet_show_user_comments_approved', 'true' );
274- else
275- update_option( 'akismet_show_user_comments_approved', 'false' );
276-
277 } elseif ( isset($_POST['check']) ) {
278 akismet_get_server_connectivity(0);
279 }
280@@ -120,24 +97,19 @@
281
282 $messages = array(
283 'new_key_empty' => array('color' => 'aa0', 'text' => __('Your key has been cleared.')),
284- 'new_key_valid' => array('color' => '4AB915', 'text' => __('Your key has been verified. Happy blogging!')),
285- 'new_key_invalid' => array('color' => '888', 'text' => __('The key you entered is invalid. Please double-check it.')),
286- 'new_key_failed' => array('color' => '888', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.')),
287- 'no_connection' => array('color' => '888', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.')),
288+ 'new_key_valid' => array('color' => '2d2', 'text' => __('Your key has been verified. Happy blogging!')),
289+ 'new_key_invalid' => array('color' => 'd22', 'text' => __('The key you entered is invalid. Please double-check it.')),
290+ 'new_key_failed' => array('color' => 'd22', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.')),
291+ 'no_connection' => array('color' => 'd22', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.')),
292 'key_empty' => array('color' => 'aa0', 'text' => sprintf(__('Please enter an API key. (<a href="%s" style="color:#fff">Get your key.</a>)'), 'http://akismet.com/get/')),
293- 'key_valid' => array('color' => '4AB915', 'text' => __('This key is valid.')),
294- 'key_failed' => array('color' => 'aa0', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.')),
295- 'bad_home_url' => array('color' => '888', 'text' => sprintf( __('Your WordPress home URL %s is invalid. Please fix the <a href="%s">home option</a>.'), esc_html( get_bloginfo('url') ), admin_url('options.php#home') ) ),
296- );
297+ 'key_valid' => array('color' => '2d2', 'text' => __('This key is valid.')),
298+ 'key_failed' => array('color' => 'aa0', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.')));
299 ?>
300 <?php if ( !empty($_POST['submit'] ) ) : ?>
301 <div id="message" class="updated fade"><p><strong><?php _e('Options saved.') ?></strong></p></div>
302 <?php endif; ?>
303 <div class="wrap">
304 <h2><?php _e('Akismet Configuration'); ?></h2>
305-<?php if (isset($_GET['message']) && $_GET['message'] == 'success') { ?>
306- <div class="updated below-h2" id="message"><p><?php _e( '<strong>Sign up success!</strong> Please check your email for your Akismet API Key and enter it below.' ); ?></p></div>
307-<?php } ?>
308 <div class="narrow">
309 <form action="" method="post" id="akismet-conf" style="margin: auto; width: 400px; ">
310 <?php if ( !$wpcom_api_key ) { ?>
311@@ -154,8 +126,7 @@
312 <?php } ?>
313 <?php } ?>
314 <?php akismet_nonce_field($akismet_nonce) ?>
315-<p><label><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php if ( get_option('akismet_discard_month') == 'true' ) echo ' checked="checked" '; ?> /> <?php _e('Auto-delete spam submitted on posts more than a month old.'); ?></label></p>
316-<p><label><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php if ( get_option('akismet_show_user_comments_approved') == 'true' ) echo ' checked="checked" '; ?> /> <?php _e('Show the number of comments you\'ve approved beside each comment author.'); ?></label></p>
317+<p><label><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php if ( get_option('akismet_discard_month') == 'true' ) echo ' checked="checked" '; ?> /> <?php _e('Automatically discard spam comments on posts older than a month.'); ?></label></p>
318 <p class="submit"><input type="submit" name="submit" value="<?php _e('Update options &raquo;'); ?>" /></p>
319 </form>
320
321@@ -165,7 +136,7 @@
322 <?php
323 if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') ) {
324 ?>
325- <p style="padding: .5em; background-color: #888; color: #fff; font-weight:bold;"><?php _e('Network functions are disabled.'); ?></p>
326+ <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Network functions are disabled.'); ?></p>
327 <p><?php echo sprintf( __('Your web host or server administrator has disabled PHP\'s <code>fsockopen</code> or <code>gethostbynamel</code> functions. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet\'s system requirements</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
328 <?php
329 } else {
330@@ -179,18 +150,18 @@
331 <?php
332 // all connections fail
333 } elseif ( $fail_count > 0 ) { ?>
334- <p style="padding: .5em; background-color: #888; color: #fff; font-weight:bold;"><?php _e('Unable to reach any Akismet servers.'); ?></p>
335+ <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Unable to reach any Akismet servers.'); ?></p>
336 <p><?php echo sprintf( __('A network problem or firewall is blocking all connections from your web server to Akismet.com. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
337 <?php
338 // all connections work
339 } else { ?>
340- <p style="padding: .5em; background-color: #4AB915; color: #fff; font-weight:bold;"><?php _e('All Akismet servers are available.'); ?></p>
341+ <p style="padding: .5em; background-color: #2d2; color: #fff; font-weight:bold;"><?php _e('All Akismet servers are available.'); ?></p>
342 <p><?php _e('Akismet is working correctly. All servers are accessible.'); ?></p>
343 <?php
344 }
345 } else {
346 ?>
347- <p style="padding: .5em; background-color: #888; color: #fff; font-weight:bold;"><?php _e('Unable to find Akismet servers.'); ?></p>
348+ <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Unable to find Akismet servers.'); ?></p>
349 <p><?php echo sprintf( __('A DNS problem or firewall is preventing all access from your web server to Akismet.com. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
350 <?php
351 }
352@@ -204,11 +175,11 @@
353 <?php
354 asort($servers);
355 foreach ( $servers as $ip => $status ) {
356- $color = ( $status ? '#4AB915' : '#888');
357+ $color = ( $status ? '#2d2' : '#d22');
358 ?>
359 <tr>
360 <td><?php echo htmlspecialchars($ip); ?></td>
361- <td style="padding: 0 .5em; font-weight:bold; color: #fff; background-color: <?php echo $color; ?>"><?php echo ($status ? __('Accessible') : __('Re-trying') ); ?></td>
362+ <td style="padding: 0 .5em; font-weight:bold; color: #fff; background-color: <?php echo $color; ?>"><?php echo ($status ? __('No problems') : __('Obstructed') ); ?></td>
363
364 <?php
365 }
366@@ -218,7 +189,6 @@
367 </table>
368 <p><?php if ( get_option('akismet_connectivity_time') ) echo sprintf( __('Last checked %s ago.'), human_time_diff( get_option('akismet_connectivity_time') ) ); ?></p>
369 <p class="submit"><input type="submit" name="check" value="<?php _e('Check network status &raquo;'); ?>" /></p>
370- <p><?php printf( __('<a href="%s" target="_blank">Click here</a> to confirm that <a href="%s" target="_blank">Akismet.com is up</a>.'), 'http://status.automattic.com/9931/136079/Akismet-API', 'http://status.automattic.com/9931/136079/Akismet-API' ); ?></p>
371 </form>
372
373 </div>
374@@ -236,8 +206,11 @@
375 ?>
376 <script type="text/javascript">
377 function resizeIframe() {
378-
379- document.getElementById('akismet-stats-frame').style.height = "2500px";
380+ var height = document.documentElement.clientHeight;
381+ height -= document.getElementById('akismet-stats-frame').offsetTop;
382+ height += 100; // magic padding
383+
384+ document.getElementById('akismet-stats-frame').style.height = height +"px";
385
386 };
387 function resizeIframeInit() {
388@@ -251,7 +224,7 @@
389
390 function akismet_stats_display() {
391 global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
392- $blog = urlencode( get_bloginfo('url') );
393+ $blog = urlencode( get_option('home') );
394
395 $url = 'http://';
396 if ( is_ssl() )
397@@ -272,13 +245,13 @@
398 if ( !$count = get_option('akismet_spam_count') )
399 return;
400 $path = plugin_basename(__FILE__);
401- echo '<h3>' . _x( 'Spam', 'comments' ) . '</h3>';
402+ echo '<h3>'.__('Spam').'</h3>';
403 global $submenu;
404 if ( isset( $submenu['edit-comments.php'] ) )
405 $link = 'edit-comments.php';
406 else
407 $link = 'edit.php';
408- echo '<p>'.sprintf( _n( '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.', '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.', $count ), 'http://akismet.com/', clean_url("$link?page=akismet-admin"), number_format_i18n($count) ).'</p>';
409+ echo '<p>'.sprintf(__('<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.'), 'http://akismet.com/', clean_url("$link?page=akismet-admin"), number_format_i18n($count) ).'</p>';
410 }
411 add_action('activity_box_end', 'akismet_stats');
412
413@@ -292,14 +265,10 @@
414 }
415 add_action('admin_notices', 'akismet_warning');
416 return;
417- } elseif ( ( empty($_SERVER['SCRIPT_FILENAME']) || basename($_SERVER['SCRIPT_FILENAME']) == 'edit-comments.php' ) && wp_next_scheduled('akismet_schedule_cron_recheck') ) {
418+ } elseif ( get_option('akismet_connectivity_time') && empty($_POST) && is_admin() && !akismet_server_connectivity_ok() ) {
419 function akismet_warning() {
420- global $wpdb;
421- $waiting = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->commentmeta WHERE meta_key = 'akismet_error'" ) );
422- $next_check = human_time_diff( wp_next_scheduled('akismet_schedule_cron_recheck') );
423- if ( $waiting > 0 )
424- echo "
425- <div id='akismet-warning' class='updated fade'><p><strong>".__('Akismet has detected a problem.')."</strong> ".sprintf(_n('A server or network problem prevented Akismet from checking %d comment. It has been temporarily held for moderation and will be automatically re-checked in %s.', 'A server or network problem prevented Akismet from checking %d comments. They have been temporarily held for moderation and will be automatically re-checked in %s.', $waiting), number_format_i18n( $waiting ), $next_check)."</p></div>
426+ echo "
427+ <div id='akismet-warning' class='updated fade'><p><strong>".__('Akismet has detected a problem.')."</strong> ".sprintf(__('A server or network problem is preventing Akismet from working correctly. <a href="%1$s">Click here for more information</a> about how to fix the problem.'), "plugins.php?page=akismet-key-config")."</p></div>
428 ";
429 }
430 add_action('admin_notices', 'akismet_warning');
431@@ -310,21 +279,17 @@
432 // FIXME placeholder
433
434 function akismet_comment_row_action( $a, $comment ) {
435-
436- // failsafe for old WP versions
437- if ( !function_exists('add_comment_meta') )
438- return $a;
439-
440+
441+
442 $akismet_result = get_comment_meta( $comment->comment_ID, 'akismet_result', true );
443 $user_result = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true);
444- $comment_status = wp_get_comment_status( $comment->comment_ID );
445 $desc = null;
446 if ( !$user_result || $user_result == $akismet_result ) {
447 // Show the original Akismet result if the user hasn't overridden it, or if their decision was the same
448- if ( $akismet_result == 'true' && $comment_status != 'spam' && $comment_status != 'trash' )
449- $desc = __( 'Flagged as spam by Akismet' );
450- elseif ( $akismet_result == 'false' && $comment_status == 'spam' )
451- $desc = __( 'Cleared by Akismet' );
452+ if ( $akismet_result == 'true' )
453+ $desc = 'Flagged as spam by Akismet';
454+ elseif ( $akismet_result == 'false' )
455+ $desc = 'Cleared by Akismet';
456 } else {
457 $who = get_comment_meta( $comment->comment_ID, 'akismet_user', true );
458 if ( $user_result == 'true' )
459@@ -332,33 +297,16 @@
460 else
461 $desc = sprintf( __('Un-spammed by %s'), $who );
462 }
463-
464- // add a History item to the hover links, just after Edit
465- if ( $akismet_result ) {
466- $b = array();
467- foreach ( $a as $k => $item ) {
468- $b[ $k ] = $item;
469- if ( $k == 'edit' )
470- $b['history'] = '<a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'#akismet-status" title="'. esc_attr__( 'View comment history' ) . '"> '. __('History') . '</a>';
471- }
472-
473- $a = $b;
474- }
475-
476+
477 if ( $desc )
478- echo '<span class="akismet-status" commentid="'.$comment->comment_ID.'"><a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'#akismet-status" title="' . esc_attr__( 'View comment history' ) . '">'.htmlspecialchars($desc).'</a></span>';
479-
480- if ( apply_filters( 'akismet_show_user_comments_approved', get_option('akismet_show_user_comments_approved') ) == 'true' ) {
481- $comment_count = akismet_get_user_comments_approved( $comment->user_id, $comment->comment_author_email, $comment->comment_author, $comment->comment_author_url );
482- $comment_count = intval( $comment_count );
483- echo '<span class="akismet-user-comment-count" commentid="'.$comment->comment_ID.'" style="display:none;"><br><span class="akismet-user-comment-counts">'.sprintf( _n( '%s approved', '%s approved', $comment_count ), number_format_i18n( $comment_count ) ) . '</span></span>';
484- }
485+ echo '<span style="background: #EEE; border: 1px solid #E4E4E4; margin-top: 3px; color: #999; padding: 1px 8px 2px 8px; -moz-border-radius:6px; border-radius:6px; -webkit-border-radius:6px; float: right; line-height: 1.2em;"><a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'#akismet-status" title="' . esc_attr__( 'View comment history' ) . '">'.htmlspecialchars($desc).'</a></span>';
486
487 return $a;
488 }
489
490 add_filter( 'comment_row_actions', 'akismet_comment_row_action', 10, 2 );
491
492+
493 function akismet_comment_status_meta_box($comment) {
494 $history = akismet_get_comment_history( $comment->comment_ID );
495
496@@ -406,28 +354,14 @@
497
498 // END FIXME
499
500-// call out URLS in comments
501-function akismet_text_add_link_callback( $m ) {
502-
503- // bare link?
504- if ( $m[4] == $m[2] )
505- return '<a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a>';
506- else
507- return '<span title="'.$m[2].'" class="comment-link"><a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a></span>';
508-}
509-
510-function akismet_text_add_link_class( $comment_text ) {
511-
512- return preg_replace_callback( '#<a ([^>]*)href="([^"]+)"([^>]*)>(.*?)</a>#i', 'akismet_text_add_link_callback', $comment_text );
513-}
514-
515-add_filter('comment_text', 'akismet_text_add_link_class');
516-
517-
518 // WP 2.5+
519 function akismet_rightnow() {
520 global $submenu, $wp_db_version;
521
522+ $plural_func = '__ngettext';
523+ if ( function_exists( '_n' ) )
524+ $plural_func = '_n';
525+
526 // clean_url was deprecated in WP 3.0
527 $esc_url = 'clean_url';
528 if ( function_exists( 'esc_url' ) )
529@@ -441,26 +375,31 @@
530 $link = 'edit.php?page=akismet-admin';
531
532 if ( $count = get_option('akismet_spam_count') ) {
533- $intro = sprintf( _n(
534- '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',
535- '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already. ',
536+ $intro = sprintf( $plural_func(
537+ '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already,',
538+ '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already,',
539 $count
540 ), 'http://akismet.com/', number_format_i18n( $count ) );
541 } else {
542- $intro = sprintf( __('<a href="%1$s">Akismet</a> blocks spam from getting to your blog. '), 'http://akismet.com/' );
543+ $intro = sprintf( __('<a href="%1$s">Akismet</a> blocks spam from getting to your blog,'), 'http://akismet.com/' );
544 }
545
546 if ( $queue_count = akismet_spam_count() ) {
547- $queue_text = sprintf( _n(
548- 'There\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
549- 'There are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
550+ $queue_text = sprintf( $plural_func(
551+ 'and there\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
552+ 'and there are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
553 $queue_count
554 ), number_format_i18n( $queue_count ), $esc_url($link) );
555 } else {
556- $queue_text = sprintf( __( "There's nothing in your <a href='%1\$s'>spam queue</a> at the moment." ), $esc_url($link) );
557+ $queue_text = sprintf( __( " but there's nothing in your <a href='%1\$s'>spam queue</a> at the moment." ), $esc_url($link) );
558 }
559
560- $text = $intro . '<br />' . $queue_text;
561+ // _c was deprecated in WP 2.9.0
562+ if ( function_exists( '_x' ) )
563+ $text = sprintf( _x( '%1$s%2$s', 'akismet_rightnow' ), $intro, $queue_text );
564+ else
565+ $text = sprintf( _c( '%1$s%2$s|akismet_rightnow' ), $intro, $queue_text );
566+
567 echo "<p class='akismet-right-now'>$text</p>\n";
568 }
569
570@@ -486,18 +425,10 @@
571 $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'");
572 if ( !$comment ) // it was deleted
573 return;
574-
575- // use the original version stored in comment_meta if available
576- $as_submitted = get_comment_meta( $comment_id, 'akismet_as_submitted', true);
577- if ( $as_submitted && is_array($as_submitted) && isset($as_submitted['comment_content']) ) {
578- $comment = (object) array_merge( (array)$comment, $as_submitted );
579- }
580-
581- $comment->blog = get_bloginfo('url');
582+ $comment->blog = get_option('home');
583 $comment->blog_lang = get_locale();
584 $comment->blog_charset = get_option('blog_charset');
585 $comment->permalink = get_permalink($comment->comment_post_ID);
586- $comment->reporter_ip = $_SERVER['REMOTE_ADDR'];
587 if ( is_object($current_user) ) {
588 $comment->reporter = $current_user->user_login;
589 }
590@@ -509,18 +440,17 @@
591 if ( isset( $comment->user_ID ) )
592 $comment->user_role = akismet_get_user_roles($comment->user_ID);
593
594- if ( akismet_test_mode() )
595- $comment->is_test = 'true';
596-
597 $query_string = '';
598 foreach ( $comment as $key => $data )
599 $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
600
601 $response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-ham", $akismet_api_port);
602 if ( $comment->reporter ) {
603- akismet_update_comment_history( $comment_id, sprintf( __('%s reported this comment as not spam'), $comment->reporter ), 'report-ham' );
604+ akismet_update_comment_history( $comment_id, sprintf( __('%s un-spammed this comment'), $comment->reporter ), 'report-ham' );
605 update_comment_meta( $comment_id, 'akismet_user_result', 'false' );
606 update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
607+ } else {
608+ akismet_update_comment_history( $comment_id, 'A plugin un-spammed this comment', 'report-ham' );
609 }
610
611 do_action('akismet_submit_nonspam_comment', $comment_id, $response[1]);
612@@ -535,18 +465,10 @@
613 return;
614 if ( 'spam' != $comment->comment_approved )
615 return;
616-
617- // use the original version stored in comment_meta if available
618- $as_submitted = get_comment_meta( $comment_id, 'akismet_as_submitted', true);
619- if ( $as_submitted && is_array($as_submitted) && isset($as_submitted['comment_content']) ) {
620- $comment = (object) array_merge( (array)$comment, $as_submitted );
621- }
622-
623- $comment->blog = get_bloginfo('url');
624+ $comment->blog = get_option('home');
625 $comment->blog_lang = get_locale();
626 $comment->blog_charset = get_option('blog_charset');
627 $comment->permalink = get_permalink($comment->comment_post_ID);
628- $comment->reporter_ip = $_SERVER['REMOTE_ADDR'];
629 if ( is_object($current_user) ) {
630 $comment->reporter = $current_user->user_login;
631 }
632@@ -555,22 +477,20 @@
633 }
634
635 $comment->user_role = '';
636- if ( isset( $comment->user_ID ) )
637+ if ( !isset( $comment->user_id ) )
638 $comment->user_role = akismet_get_user_roles($comment->user_ID);
639
640- if ( akismet_test_mode() )
641- $comment->is_test = 'true';
642-
643 $query_string = '';
644 foreach ( $comment as $key => $data )
645 $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
646
647 $response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-spam", $akismet_api_port);
648 if ( $comment->reporter ) {
649- akismet_update_comment_history( $comment_id, sprintf( __('%s reported this comment as spam'), $comment->reporter ), 'report-spam' );
650+ akismet_update_comment_history( $comment_id, sprintf( __('%s spammed this comment'), $comment->reporter ), 'report-spam' );
651 update_comment_meta( $comment_id, 'akismet_user_result', 'true' );
652 update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
653- }
654+ } else
655+ akismet_update_comment_history( $comment_id, 'A plugin spammed this comment', 'report-ham' );
656 do_action('akismet_submit_spam_comment', $comment_id, $response[1]);
657 }
658
659@@ -579,36 +499,11 @@
660 if ( $new_status == $old_status )
661 return;
662
663- if ( !is_admin() )
664- return;
665-
666- if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) && !current_user_can( 'moderate_comments' ) )
667- return;
668-
669- if ( defined('WP_IMPORTING') && WP_IMPORTING == true )
670- return;
671-
672- global $current_user;
673- $reporter = '';
674- if ( is_object( $current_user ) )
675- $reporter = $current_user->user_login;
676-
677- // Assumption alert:
678- // We want to submit comments to Akismet only when a moderator explicitly spams or approves it - not if the status
679- // is changed automatically by another plugin. Unfortunately WordPress doesn't provide an unambiguous way to
680- // determine why the transition_comment_status action was triggered. And there are several different ways by which
681- // to spam and unspam comments: bulk actions, ajax, links in moderation emails, the dashboard, and perhaps others.
682- // We'll assume that this is an explicit user action if POST or GET has an 'action' key.
683- if ( isset($_POST['action']) || isset($_GET['action']) ) {
684- if ( $new_status == 'spam' && ( $old_status == 'approved' || $old_status == 'unapproved' || !$old_status ) ) {
685- return akismet_submit_spam_comment( $comment->comment_ID );
686- } elseif ( $old_status == 'spam' && ( $new_status == 'approved' || $new_status == 'unapproved' ) ) {
687- return akismet_submit_nonspam_comment( $comment->comment_ID );
688- }
689+ if ( $new_status == 'spam' ) {
690+ akismet_submit_spam_comment( $comment->comment_ID );
691+ } elseif ( $old_status == 'spam' && ( $new_status == 'approved' || $new_status == 'unapproved' ) ) {
692+ akismet_submit_nonspam_comment( $comment->comment_ID );
693 }
694-
695- if ( !get_comment_meta( $comment->comment_ID, 'akismet_rechecking' ) )
696- akismet_update_comment_history( $comment->comment_ID, sprintf( __('%s changed the comment status to %s'), $reporter, $new_status ), 'status-' . $new_status );
697 }
698
699 add_action( 'transition_comment_status', 'akismet_transition_comment_status', 10, 3 );
700@@ -651,7 +546,7 @@
701 $c['user_ip'] = $c['comment_author_IP'];
702 $c['user_agent'] = $c['comment_agent'];
703 $c['referrer'] = '';
704- $c['blog'] = get_bloginfo('url');
705+ $c['blog'] = get_option('home');
706 $c['blog_lang'] = get_locale();
707 $c['blog_charset'] = get_option('blog_charset');
708 $c['permalink'] = get_permalink($c['comment_post_ID']);
709@@ -660,9 +555,6 @@
710 if ( isset( $c['user_ID'] ) )
711 $c['user_role'] = akismet_get_user_roles($c['user_ID']);
712
713- if ( akismet_test_mode() )
714- $c['is_test'] = 'true';
715-
716 $id = (int) $c['comment_ID'];
717
718 $query_string = '';
719@@ -690,57 +582,3 @@
720 }
721
722 add_action('admin_action_akismet_recheck_queue', 'akismet_recheck_queue');
723-
724-// Check connectivity between the WordPress blog and Akismet's servers.
725-// Returns an associative array of server IP addresses, where the key is the IP address, and value is true (available) or false (unable to connect).
726-function akismet_check_server_connectivity() {
727- global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
728-
729- $test_host = 'rest.akismet.com';
730-
731- // Some web hosts may disable one or both functions
732- if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') )
733- return array();
734-
735- $ips = gethostbynamel($test_host);
736- if ( !$ips || !is_array($ips) || !count($ips) )
737- return array();
738-
739- $servers = array();
740- foreach ( $ips as $ip ) {
741- $response = akismet_verify_key( akismet_get_key(), $ip );
742- // even if the key is invalid, at least we know we have connectivity
743- if ( $response == 'valid' || $response == 'invalid' )
744- $servers[$ip] = true;
745- else
746- $servers[$ip] = false;
747- }
748-
749- return $servers;
750-}
751-
752-// Check the server connectivity and store the results in an option.
753-// Cached results will be used if not older than the specified timeout in seconds; use $cache_timeout = 0 to force an update.
754-// Returns the same associative array as akismet_check_server_connectivity()
755-function akismet_get_server_connectivity( $cache_timeout = 86400 ) {
756- $servers = get_option('akismet_available_servers');
757- if ( (time() - get_option('akismet_connectivity_time') < $cache_timeout) && $servers !== false )
758- return $servers;
759-
760- // There's a race condition here but the effect is harmless.
761- $servers = akismet_check_server_connectivity();
762- update_option('akismet_available_servers', $servers);
763- update_option('akismet_connectivity_time', time());
764- return $servers;
765-}
766-
767-// Returns true if server connectivity was OK at the last check, false if there was a problem that needs to be fixed.
768-function akismet_server_connectivity_ok() {
769- // skip the check on WPMU because the status page is hidden
770- global $wpcom_api_key;
771- if ( $wpcom_api_key )
772- return true;
773- $servers = akismet_get_server_connectivity();
774- return !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );
775-}
776-
777
778=== modified file 'wp-content/plugins/akismet/akismet.php'
779--- wp-content/plugins/akismet/akismet.php 2011-01-25 15:58:41 +0000
780+++ wp-content/plugins/akismet/akismet.php 2011-02-18 16:29:18 +0000
781@@ -5,31 +5,29 @@
782 /*
783 Plugin Name: Akismet
784 Plugin URI: http://akismet.com/
785-Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and track-back spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your <a href="plugins.php?page=akismet-key-config">Akismet configuration</a> page, and save your API key.
786-Version: 2.5.2
787+Description: Akismet checks your comments against the Akismet web service to see if they look like spam or not. You need an <a href="http://akismet.com/get/">API key</a> to use it. You can review the spam it catches under "Comments." To show off your Akismet stats just put <code>&lt;?php akismet_counter(); ?&gt;</code> in your template. See also: <a href="http://wordpress.org/extend/plugins/stats/">WP Stats plugin</a>.
788+Version: 2.4.0
789 Author: Automattic
790 Author URI: http://automattic.com/wordpress-plugins/
791 License: GPLv2
792 */
793
794 /*
795-This program is free software; you can redistribute it and/or
796-modify it under the terms of the GNU General Public License
797-as published by the Free Software Foundation; either version 2
798-of the License, or (at your option) any later version.
799-
800-This program is distributed in the hope that it will be useful,
801-but WITHOUT ANY WARRANTY; without even the implied warranty of
802-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
803-GNU General Public License for more details.
804-
805-You should have received a copy of the GNU General Public License
806-along with this program; if not, write to the Free Software
807-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
808+This program is free software; you can redistribute it and/or modify
809+it under the terms of the GNU General Public License as published by
810+the Free Software Foundation; version 2 of the License.
811+
812+This program is distributed in the hope that it will be useful,
813+but WITHOUT ANY WARRANTY; without even the implied warranty of
814+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
815+GNU General Public License for more details.
816+
817+You should have received a copy of the GNU General Public License
818+along with this program; if not, write to the Free Software
819+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
820 */
821
822-define('AKISMET_VERSION', '2.5.2');
823-define('AKISMET_PLUGIN_URL', plugin_dir_url( __FILE__ ));
824+define('AKISMET_VERSION', '2.4.0');
825
826 /** If you hardcode a WP.com API key here, all key config screens will be hidden */
827 if ( defined('WPCOM_API_KEY') )
828@@ -43,13 +41,8 @@
829 exit;
830 }
831
832-if ( isset($wp_db_version) && $wp_db_version <= 9872 )
833- include_once dirname( __FILE__ ) . '/legacy.php';
834-
835-include_once dirname( __FILE__ ) . '/widget.php';
836-
837-if ( is_admin() )
838- require_once dirname( __FILE__ ) . '/admin.php';
839+if ( $wp_db_version <= 9872 )
840+ include_once( dirname(__FILE__) . '/legacy.php' );
841
842 function akismet_init() {
843 global $wpcom_api_key, $akismet_api_host, $akismet_api_port;
844@@ -60,9 +53,251 @@
845 $akismet_api_host = get_option('wordpress_api_key') . '.rest.akismet.com';
846
847 $akismet_api_port = 80;
848+ add_action('admin_menu', 'akismet_config_page');
849+ add_action('admin_menu', 'akismet_stats_page');
850+ akismet_admin_warnings();
851 }
852 add_action('init', 'akismet_init');
853
854+function akismet_admin_init() {
855+ if ( function_exists( 'get_plugin_page_hook' ) )
856+ $hook = get_plugin_page_hook( 'akismet-stats-display', 'index.php' );
857+ else
858+ $hook = 'dashboard_page_akismet-stats-display';
859+ add_action('admin_head-'.$hook, 'akismet_stats_script');
860+}
861+add_action('admin_init', 'akismet_admin_init');
862+
863+if ( !function_exists('wp_nonce_field') ) {
864+ function akismet_nonce_field($action = -1) { return; }
865+ $akismet_nonce = -1;
866+} else {
867+ function akismet_nonce_field($action = -1) { return wp_nonce_field($action); }
868+ $akismet_nonce = 'akismet-update-key';
869+}
870+
871+if ( !function_exists('number_format_i18n') ) {
872+ function number_format_i18n( $number, $decimals = null ) { return number_format( $number, $decimals ); }
873+}
874+
875+function akismet_config_page() {
876+ if ( function_exists('add_submenu_page') )
877+ add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 'manage_options', 'akismet-key-config', 'akismet_conf');
878+
879+}
880+
881+function akismet_conf() {
882+ global $akismet_nonce, $wpcom_api_key;
883+
884+ if ( isset($_POST['submit']) ) {
885+ if ( function_exists('current_user_can') && !current_user_can('manage_options') )
886+ die(__('Cheatin&#8217; uh?'));
887+
888+ check_admin_referer( $akismet_nonce );
889+ $key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] );
890+
891+ if ( empty($key) ) {
892+ $key_status = 'empty';
893+ $ms[] = 'new_key_empty';
894+ delete_option('wordpress_api_key');
895+ } else {
896+ $key_status = akismet_verify_key( $key );
897+ }
898+
899+ if ( $key_status == 'valid' ) {
900+ update_option('wordpress_api_key', $key);
901+ $ms[] = 'new_key_valid';
902+ } else if ( $key_status == 'invalid' ) {
903+ $ms[] = 'new_key_invalid';
904+ } else if ( $key_status == 'failed' ) {
905+ $ms[] = 'new_key_failed';
906+ }
907+
908+ if ( isset( $_POST['akismet_discard_month'] ) )
909+ update_option( 'akismet_discard_month', 'true' );
910+ else
911+ update_option( 'akismet_discard_month', 'false' );
912+ } elseif ( isset($_POST['check']) ) {
913+ akismet_get_server_connectivity(0);
914+ }
915+
916+ if ( empty( $key_status) || $key_status != 'valid' ) {
917+ $key = get_option('wordpress_api_key');
918+ if ( empty( $key ) ) {
919+ if ( empty( $key_status ) || $key_status != 'failed' ) {
920+ if ( akismet_verify_key( '1234567890ab' ) == 'failed' )
921+ $ms[] = 'no_connection';
922+ else
923+ $ms[] = 'key_empty';
924+ }
925+ $key_status = 'empty';
926+ } else {
927+ $key_status = akismet_verify_key( $key );
928+ }
929+ if ( $key_status == 'valid' ) {
930+ $ms[] = 'key_valid';
931+ } else if ( $key_status == 'invalid' ) {
932+ delete_option('wordpress_api_key');
933+ $ms[] = 'key_empty';
934+ } else if ( !empty($key) && $key_status == 'failed' ) {
935+ $ms[] = 'key_failed';
936+ }
937+ }
938+
939+ $messages = array(
940+ 'new_key_empty' => array('color' => 'aa0', 'text' => __('Your key has been cleared.')),
941+ 'new_key_valid' => array('color' => '2d2', 'text' => __('Your key has been verified. Happy blogging!')),
942+ 'new_key_invalid' => array('color' => 'd22', 'text' => __('The key you entered is invalid. Please double-check it.')),
943+ 'new_key_failed' => array('color' => 'd22', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.')),
944+ 'no_connection' => array('color' => 'd22', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.')),
945+ 'key_empty' => array('color' => 'aa0', 'text' => sprintf(__('Please enter an API key. (<a href="%s" style="color:#fff">Get your key.</a>)'), 'http://akismet.com/get/')),
946+ 'key_valid' => array('color' => '2d2', 'text' => __('This key is valid.')),
947+ 'key_failed' => array('color' => 'aa0', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.')));
948+?>
949+<?php if ( !empty($_POST['submit'] ) ) : ?>
950+<div id="message" class="updated fade"><p><strong><?php _e('Options saved.') ?></strong></p></div>
951+<?php endif; ?>
952+<div class="wrap">
953+<h2><?php _e('Akismet Configuration'); ?></h2>
954+<div class="narrow">
955+<form action="" method="post" id="akismet-conf" style="margin: auto; width: 400px; ">
956+<?php if ( !$wpcom_api_key ) { ?>
957+ <p><?php printf(__('For many people, <a href="%1$s">Akismet</a> will greatly reduce or even completely eliminate the comment and trackback spam you get on your site. If one does happen to get through, simply mark it as "spam" on the moderation screen and Akismet will learn from the mistakes. If you don\'t have an API key yet, you can get one at <a href="%2$s">Akismet.com</a>.'), 'http://akismet.com/', 'http://akismet.com/get/'); ?></p>
958+
959+<h3><label for="key"><?php _e('Akismet API Key'); ?></label></h3>
960+<?php foreach ( $ms as $m ) : ?>
961+ <p style="padding: .5em; background-color: #<?php echo $messages[$m]['color']; ?>; color: #fff; font-weight: bold;"><?php echo $messages[$m]['text']; ?></p>
962+<?php endforeach; ?>
963+<p><input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo get_option('wordpress_api_key'); ?>" style="font-family: 'Courier New', Courier, mono; font-size: 1.5em;" /> (<?php _e('<a href="http://akismet.com/get/">What is this?</a>'); ?>)</p>
964+<?php if ( isset( $invalid_key) && $invalid_key ) { ?>
965+<h3><?php _e('Why might my key be invalid?'); ?></h3>
966+<p><?php _e('This can mean one of two things, either you copied the key wrong or that the plugin is unable to reach the Akismet servers, which is most often caused by an issue with your web host around firewalls or similar.'); ?></p>
967+<?php } ?>
968+<?php } ?>
969+<?php akismet_nonce_field($akismet_nonce) ?>
970+<p><label><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php if ( get_option('akismet_discard_month') == 'true' ) echo ' checked="checked" '; ?> /> <?php _e('Automatically discard spam comments on posts older than a month.'); ?></label></p>
971+ <p class="submit"><input type="submit" name="submit" value="<?php _e('Update options &raquo;'); ?>" /></p>
972+</form>
973+
974+<form action="" method="post" id="akismet-connectivity" style="margin: auto; width: 400px; ">
975+
976+<h3><?php _e('Server Connectivity'); ?></h3>
977+<?php
978+ if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') ) {
979+ ?>
980+ <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Network functions are disabled.'); ?></p>
981+ <p><?php echo sprintf( __('Your web host or server administrator has disabled PHP\'s <code>fsockopen</code> or <code>gethostbynamel</code> functions. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet\'s system requirements</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
982+ <?php
983+ } else {
984+ $servers = akismet_get_server_connectivity();
985+ $fail_count = count($servers) - count( array_filter($servers) );
986+ if ( is_array($servers) && count($servers) > 0 ) {
987+ // some connections work, some fail
988+ if ( $fail_count > 0 && $fail_count < count($servers) ) { ?>
989+ <p style="padding: .5em; background-color: #aa0; color: #fff; font-weight:bold;"><?php _e('Unable to reach some Akismet servers.'); ?></p>
990+ <p><?php echo sprintf( __('A network problem or firewall is blocking some connections from your web server to Akismet.com. Akismet is working but this may cause problems during times of network congestion. Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
991+ <?php
992+ // all connections fail
993+ } elseif ( $fail_count > 0 ) { ?>
994+ <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Unable to reach any Akismet servers.'); ?></p>
995+ <p><?php echo sprintf( __('A network problem or firewall is blocking all connections from your web server to Akismet.com. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
996+ <?php
997+ // all connections work
998+ } else { ?>
999+ <p style="padding: .5em; background-color: #2d2; color: #fff; font-weight:bold;"><?php _e('All Akismet servers are available.'); ?></p>
1000+ <p><?php _e('Akismet is working correctly. All servers are accessible.'); ?></p>
1001+ <?php
1002+ }
1003+ } else {
1004+ ?>
1005+ <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Unable to find Akismet servers.'); ?></p>
1006+ <p><?php echo sprintf( __('A DNS problem or firewall is preventing all access from your web server to Akismet.com. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1007+ <?php
1008+ }
1009+ }
1010+
1011+ if ( !empty($servers) ) {
1012+?>
1013+<table style="width: 100%;">
1014+<thead><th><?php _e('Akismet server'); ?></th><th><?php _e('Network Status'); ?></th></thead>
1015+<tbody>
1016+<?php
1017+ asort($servers);
1018+ foreach ( $servers as $ip => $status ) {
1019+ $color = ( $status ? '#2d2' : '#d22');
1020+ ?>
1021+ <tr>
1022+ <td><?php echo htmlspecialchars($ip); ?></td>
1023+ <td style="padding: 0 .5em; font-weight:bold; color: #fff; background-color: <?php echo $color; ?>"><?php echo ($status ? __('No problems') : __('Obstructed') ); ?></td>
1024+
1025+ <?php
1026+ }
1027+ }
1028+?>
1029+</tbody>
1030+</table>
1031+ <p><?php if ( get_option('akismet_connectivity_time') ) echo sprintf( __('Last checked %s ago.'), human_time_diff( get_option('akismet_connectivity_time') ) ); ?></p>
1032+ <p class="submit"><input type="submit" name="check" value="<?php _e('Check network status &raquo;'); ?>" /></p>
1033+</form>
1034+
1035+</div>
1036+</div>
1037+<?php
1038+}
1039+
1040+function akismet_stats_page() {
1041+ if ( function_exists('add_submenu_page') )
1042+ add_submenu_page('index.php', __('Akismet Stats'), __('Akismet Stats'), 'manage_options', 'akismet-stats-display', 'akismet_stats_display');
1043+
1044+}
1045+
1046+function akismet_stats_script() {
1047+ ?>
1048+<script type="text/javascript">
1049+function resizeIframe() {
1050+ var height = document.documentElement.clientHeight;
1051+ height -= document.getElementById('akismet-stats-frame').offsetTop;
1052+ height += 100; // magic padding
1053+
1054+ document.getElementById('akismet-stats-frame').style.height = height +"px";
1055+
1056+};
1057+function resizeIframeInit() {
1058+ document.getElementById('akismet-stats-frame').onload = resizeIframe;
1059+ window.onresize = resizeIframe;
1060+}
1061+addLoadEvent(resizeIframeInit);
1062+</script><?php
1063+}
1064+
1065+
1066+function akismet_stats_display() {
1067+ global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
1068+ $blog = urlencode( get_option('home') );
1069+ $url = "http://".akismet_get_key().".web.akismet.com/1.0/user-stats.php?blog={$blog}";
1070+ ?>
1071+ <div class="wrap">
1072+ <iframe src="<?php echo $url; ?>" width="100%" height="100%" frameborder="0" id="akismet-stats-frame"></iframe>
1073+ </div>
1074+ <?php
1075+}
1076+
1077+function akismet_stats() {
1078+ if ( !function_exists('did_action') || did_action( 'rightnow_end' ) ) // We already displayed this info in the "Right Now" section
1079+ return;
1080+ if ( !$count = get_option('akismet_spam_count') )
1081+ return;
1082+ $path = plugin_basename(__FILE__);
1083+ echo '<h3>'.__('Spam').'</h3>';
1084+ global $submenu;
1085+ if ( isset( $submenu['edit-comments.php'] ) )
1086+ $link = 'edit-comments.php';
1087+ else
1088+ $link = 'edit.php';
1089+ echo '<p>'.sprintf(__('<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.'), 'http://akismet.com/', clean_url("$link?page=akismet-admin"), number_format_i18n($count) ).'</p>';
1090+}
1091+add_action('activity_box_end', 'akismet_stats');
1092+
1093 function akismet_get_key() {
1094 global $wpcom_api_key;
1095 if ( !empty($wpcom_api_key) )
1096@@ -81,11 +316,104 @@
1097 return $response[1];
1098 }
1099
1100-// if we're in debug or test modes, use a reduced service level so as not to polute training or stats data
1101-function akismet_test_mode() {
1102- if ( defined('AKISMET_TEST_MODE') && AKISMET_TEST_MODE )
1103+// Check connectivity between the WordPress blog and Akismet's servers.
1104+// Returns an associative array of server IP addresses, where the key is the IP address, and value is true (available) or false (unable to connect).
1105+function akismet_check_server_connectivity() {
1106+ global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
1107+
1108+ $test_host = 'rest.akismet.com';
1109+
1110+ // Some web hosts may disable one or both functions
1111+ if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') )
1112+ return array();
1113+
1114+ $ips = gethostbynamel($test_host);
1115+ if ( !$ips || !is_array($ips) || !count($ips) )
1116+ return array();
1117+
1118+ $servers = array();
1119+ foreach ( $ips as $ip ) {
1120+ $response = akismet_verify_key( akismet_get_key(), $ip );
1121+ // even if the key is invalid, at least we know we have connectivity
1122+ if ( $response == 'valid' || $response == 'invalid' )
1123+ $servers[$ip] = true;
1124+ else
1125+ $servers[$ip] = false;
1126+ }
1127+
1128+ return $servers;
1129+}
1130+
1131+// Check the server connectivity and store the results in an option.
1132+// Cached results will be used if not older than the specified timeout in seconds; use $cache_timeout = 0 to force an update.
1133+// Returns the same associative array as akismet_check_server_connectivity()
1134+function akismet_get_server_connectivity( $cache_timeout = 86400 ) {
1135+ $servers = get_option('akismet_available_servers');
1136+ if ( (time() - get_option('akismet_connectivity_time') < $cache_timeout) && $servers !== false )
1137+ return $servers;
1138+
1139+ // There's a race condition here but the effect is harmless.
1140+ $servers = akismet_check_server_connectivity();
1141+ update_option('akismet_available_servers', $servers);
1142+ update_option('akismet_connectivity_time', time());
1143+ return $servers;
1144+}
1145+
1146+// Returns true if server connectivity was OK at the last check, false if there was a problem that needs to be fixed.
1147+function akismet_server_connectivity_ok() {
1148+ // skip the check on WPMU because the status page is hidden
1149+ global $wpcom_api_key;
1150+ if ( $wpcom_api_key )
1151 return true;
1152- return false;
1153+ $servers = akismet_get_server_connectivity();
1154+ return !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );
1155+}
1156+
1157+function akismet_admin_warnings() {
1158+ global $wpcom_api_key;
1159+ if ( !get_option('wordpress_api_key') && !$wpcom_api_key && !isset($_POST['submit']) ) {
1160+ function akismet_warning() {
1161+ echo "
1162+ <div id='akismet-warning' class='updated fade'><p><strong>".__('Akismet is almost ready.')."</strong> ".sprintf(__('You must <a href="%1$s">enter your Akismet API key</a> for it to work.'), "plugins.php?page=akismet-key-config")."</p></div>
1163+ ";
1164+ }
1165+ add_action('admin_notices', 'akismet_warning');
1166+ return;
1167+ } elseif ( get_option('akismet_connectivity_time') && empty($_POST) && is_admin() && !akismet_server_connectivity_ok() ) {
1168+ function akismet_warning() {
1169+ echo "
1170+ <div id='akismet-warning' class='updated fade'><p><strong>".__('Akismet has detected a problem.')."</strong> ".sprintf(__('A server or network problem is preventing Akismet from working correctly. <a href="%1$s">Click here for more information</a> about how to fix the problem.'), "plugins.php?page=akismet-key-config")."</p></div>
1171+ ";
1172+ }
1173+ add_action('admin_notices', 'akismet_warning');
1174+ return;
1175+ }
1176+}
1177+
1178+function akismet_get_host($host) {
1179+ // if all servers are accessible, just return the host name.
1180+ // if not, return an IP that was known to be accessible at the last check.
1181+ if ( akismet_server_connectivity_ok() ) {
1182+ return $host;
1183+ } else {
1184+ $ips = akismet_get_server_connectivity();
1185+ // a firewall may be blocking access to some Akismet IPs
1186+ if ( count($ips) > 0 && count(array_filter($ips)) < count($ips) ) {
1187+ // use DNS to get current IPs, but exclude any known to be unreachable
1188+ $dns = (array)gethostbynamel( rtrim($host, '.') . '.' );
1189+ $dns = array_filter($dns);
1190+ foreach ( $dns as $ip ) {
1191+ if ( array_key_exists( $ip, $ips ) && empty( $ips[$ip] ) )
1192+ unset($dns[$ip]);
1193+ }
1194+ // return a random IP from those available
1195+ if ( count($dns) )
1196+ return $dns[ array_rand($dns) ];
1197+
1198+ }
1199+ }
1200+ // if all else fails try the host name
1201+ return $host;
1202 }
1203
1204 // return a comma-separated list of role names for the given user
1205@@ -100,76 +428,42 @@
1206 if ( isset($comment_user->roles) )
1207 $roles = join(',', $comment_user->roles);
1208 }
1209-
1210- if ( is_multisite() && is_super_admin( $user_id ) ) {
1211- if ( empty( $roles ) ) {
1212- $roles = 'super_admin';
1213- } else {
1214- $comment_user->roles[] = 'super_admin';
1215- $roles = join( ',', $comment_user->roles );
1216- }
1217- }
1218-
1219+
1220 return $roles;
1221 }
1222
1223 // Returns array with headers in $response[0] and body in $response[1]
1224 function akismet_http_post($request, $host, $path, $port = 80, $ip=null) {
1225 global $wp_version;
1226-
1227- $akismet_ua = "WordPress/{$wp_version} | ";
1228- $akismet_ua .= 'Akismet/' . constant( 'AKISMET_VERSION' );
1229-
1230- $content_length = strlen( $request );
1231-
1232+
1233+ $akismet_version = constant('AKISMET_VERSION');
1234+
1235+ $http_request = "POST $path HTTP/1.0\r\n";
1236+ $http_request .= "Host: $host\r\n";
1237+ $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n";
1238+ $http_request .= "Content-Length: " . strlen($request) . "\r\n";
1239+ $http_request .= "User-Agent: WordPress/$wp_version | Akismet/$akismet_version\r\n";
1240+ $http_request .= "\r\n";
1241+ $http_request .= $request;
1242+
1243 $http_host = $host;
1244- // use a specific IP if provided
1245- // needed by akismet_check_server_connectivity()
1246- if ( $ip && long2ip( ip2long( $ip ) ) ) {
1247+ // use a specific IP if provided - needed by akismet_check_server_connectivity()
1248+ if ( $ip && long2ip(ip2long($ip)) ) {
1249 $http_host = $ip;
1250 } else {
1251- $http_host = $host;
1252- }
1253-
1254- // use the WP HTTP class if it is available
1255- if ( function_exists( 'wp_remote_post' ) ) {
1256- $http_args = array(
1257- 'body' => $request,
1258- 'headers' => array(
1259- 'Content-Type' => 'application/x-www-form-urlencoded; ' .
1260- 'charset=' . get_option( 'blog_charset' ),
1261- 'Host' => $host,
1262- 'User-Agent' => $akismet_ua
1263- ),
1264- 'httpversion' => '1.0',
1265- 'timeout' => 15
1266- );
1267- $akismet_url = "http://{$http_host}{$path}";
1268- $response = wp_remote_post( $akismet_url, $http_args );
1269- if ( is_wp_error( $response ) )
1270- return '';
1271-
1272- return array( $response['headers'], $response['body'] );
1273- } else {
1274- $http_request = "POST $path HTTP/1.0\r\n";
1275- $http_request .= "Host: $host\r\n";
1276- $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . get_option('blog_charset') . "\r\n";
1277- $http_request .= "Content-Length: {$content_length}\r\n";
1278- $http_request .= "User-Agent: {$akismet_ua}\r\n";
1279- $http_request .= "\r\n";
1280- $http_request .= $request;
1281-
1282- $response = '';
1283- if( false != ( $fs = @fsockopen( $http_host, $port, $errno, $errstr, 10 ) ) ) {
1284- fwrite( $fs, $http_request );
1285-
1286- while ( !feof( $fs ) )
1287- $response .= fgets( $fs, 1160 ); // One TCP-IP packet
1288- fclose( $fs );
1289- $response = explode( "\r\n\r\n", $response, 2 );
1290- }
1291- return $response;
1292- }
1293+ $http_host = akismet_get_host($host);
1294+ }
1295+
1296+ $response = '';
1297+ if( false != ( $fs = @fsockopen($http_host, $port, $errno, $errstr, 10) ) ) {
1298+ fwrite($fs, $http_request);
1299+
1300+ while ( !feof($fs) )
1301+ $response .= fgets($fs, 1160); // One TCP-IP packet
1302+ fclose($fs);
1303+ $response = explode("\r\n\r\n", $response, 2);
1304+ }
1305+ return $response;
1306 }
1307
1308 // filter handler used to return a spam result to pre_comment_approved
1309@@ -177,122 +471,11 @@
1310 // bump the counter here instead of when the filter is added to reduce the possibility of overcounting
1311 if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
1312 update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );
1313- // this is a one-shot deal
1314- remove_filter( 'pre_comment_approved', 'akismet_result_spam' );
1315 return 'spam';
1316 }
1317
1318-function akismet_result_hold( $approved ) {
1319- // once only
1320- remove_filter( 'pre_comment_approved', 'akismet_result_hold' );
1321- return '0';
1322-}
1323-
1324-// how many approved comments does this author have?
1325-function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
1326- global $wpdb;
1327-
1328- if ( !empty($user_id) )
1329- return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE user_id = %d AND comment_approved = 1", $user_id ) );
1330-
1331- if ( !empty($comment_author_email) )
1332- return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_author_email = %s AND comment_author = %s AND comment_author_url = %s AND comment_approved = 1", $comment_author_email, $comment_author, $comment_author_url ) );
1333-
1334- return 0;
1335-}
1336-
1337-function akismet_microtime() {
1338- $mtime = explode( ' ', microtime() );
1339- return $mtime[1] + $mtime[0];
1340-}
1341-
1342-// log an event for a given comment, storing it in comment_meta
1343-function akismet_update_comment_history( $comment_id, $message, $event=null ) {
1344- global $current_user;
1345-
1346- // failsafe for old WP versions
1347- if ( !function_exists('add_comment_meta') )
1348- return false;
1349-
1350- $user = '';
1351- if ( is_object($current_user) && isset($current_user->user_login) )
1352- $user = $current_user->user_login;
1353-
1354- $event = array(
1355- 'time' => akismet_microtime(),
1356- 'message' => $message,
1357- 'event' => $event,
1358- 'user' => $user,
1359- );
1360-
1361- // $unique = false so as to allow multiple values per comment
1362- $r = add_comment_meta( $comment_id, 'akismet_history', $event, false );
1363-}
1364-
1365-// get the full comment history for a given comment, as an array in reverse chronological order
1366-function akismet_get_comment_history( $comment_id ) {
1367-
1368- // failsafe for old WP versions
1369- if ( !function_exists('add_comment_meta') )
1370- return false;
1371-
1372- $history = get_comment_meta( $comment_id, 'akismet_history', false );
1373- usort( $history, 'akismet_cmp_time' );
1374- return $history;
1375-}
1376-
1377-function akismet_cmp_time( $a, $b ) {
1378- return $a['time'] > $b['time'] ? -1 : 1;
1379-}
1380-
1381-// this fires on wp_insert_comment. we can't update comment_meta when akismet_auto_check_comment() runs
1382-// because we don't know the comment ID at that point.
1383-function akismet_auto_check_update_meta( $id, $comment ) {
1384- global $akismet_last_comment;
1385-
1386- // failsafe for old WP versions
1387- if ( !function_exists('add_comment_meta') )
1388- return false;
1389-
1390- // wp_insert_comment() might be called in other contexts, so make sure this is the same comment
1391- // as was checked by akismet_auto_check_comment
1392- if ( is_object($comment) && !empty($akismet_last_comment) && is_array($akismet_last_comment) ) {
1393- if ( intval($akismet_last_comment['comment_post_ID']) == intval($comment->comment_post_ID)
1394- && $akismet_last_comment['comment_author'] == $comment->comment_author
1395- && $akismet_last_comment['comment_author_email'] == $comment->comment_author_email ) {
1396- // normal result: true or false
1397- if ( $akismet_last_comment['akismet_result'] == 'true' ) {
1398- update_comment_meta( $comment->comment_ID, 'akismet_result', 'true' );
1399- akismet_update_comment_history( $comment->comment_ID, __('Akismet caught this comment as spam'), 'check-spam' );
1400- if ( $comment->comment_approved != 'spam' )
1401- akismet_update_comment_history( $comment->comment_ID, sprintf( __('Comment status was changed to %s'), $comment->comment_approved), 'status-changed'.$comment->comment_approved );
1402- } elseif ( $akismet_last_comment['akismet_result'] == 'false' ) {
1403- update_comment_meta( $comment->comment_ID, 'akismet_result', 'false' );
1404- akismet_update_comment_history( $comment->comment_ID, __('Akismet cleared this comment'), 'check-ham' );
1405- if ( $comment->comment_approved == 'spam' ) {
1406- if ( wp_blacklist_check($comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent) )
1407- akismet_update_comment_history( $comment->comment_ID, __('Comment was caught by wp_blacklist_check'), 'wp-blacklisted' );
1408- else
1409- akismet_update_comment_history( $comment->comment_ID, sprintf( __('Comment status was changed to %s'), $comment->comment_approved), 'status-changed-'.$comment->comment_approved );
1410- }
1411- // abnormal result: error
1412- } else {
1413- update_comment_meta( $comment->comment_ID, 'akismet_error', time() );
1414- akismet_update_comment_history( $comment->comment_ID, sprintf( __('Akismet was unable to check this comment (response: %s), will automatically retry again later.'), $akismet_last_comment['akismet_result']), 'check-error' );
1415- }
1416-
1417- // record the complete original data as submitted for checking
1418- if ( isset($akismet_last_comment['comment_as_submitted']) )
1419- update_comment_meta( $comment->comment_ID, 'akismet_as_submitted', $akismet_last_comment['comment_as_submitted'] );
1420- }
1421- }
1422-}
1423-
1424-add_action( 'wp_insert_comment', 'akismet_auto_check_update_meta', 10, 2 );
1425-
1426-
1427 function akismet_auto_check_comment( $commentdata ) {
1428- global $akismet_api_host, $akismet_api_port, $akismet_last_comment;
1429+ global $akismet_api_host, $akismet_api_port;
1430
1431 $comment = $commentdata;
1432 $comment['user_ip'] = $_SERVER['REMOTE_ADDR'];
1433@@ -305,41 +488,17 @@
1434
1435 $comment['user_role'] = akismet_get_user_roles($comment['user_ID']);
1436
1437- $akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
1438- $comment['akismet_comment_nonce'] = 'inactive';
1439- if ( $akismet_nonce_option == 'true' || $akismet_nonce_option == '' ) {
1440- $comment['akismet_comment_nonce'] = 'failed';
1441- if ( isset( $_POST['akismet_comment_nonce'] ) && wp_verify_nonce( $_POST['akismet_comment_nonce'], 'akismet_comment_nonce_' . $comment['comment_post_ID'] ) )
1442- $comment['akismet_comment_nonce'] = 'passed';
1443-
1444- // comment reply in wp-admin
1445- if ( isset( $_POST['_ajax_nonce-replyto-comment'] ) && check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' ) )
1446- $comment['akismet_comment_nonce'] = 'passed';
1447-
1448- }
1449-
1450- if ( akismet_test_mode() )
1451- $comment['is_test'] = 'true';
1452-
1453- foreach ($_POST as $key => $value ) {
1454- if ( is_string($value) )
1455- $comment["POST_{$key}"] = $value;
1456- }
1457-
1458 $ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' );
1459
1460- foreach ( $_SERVER as $key => $value ) {
1461+ foreach ( $_SERVER as $key => $value )
1462 if ( !in_array( $key, $ignore ) && is_string($value) )
1463 $comment["$key"] = $value;
1464 else
1465 $comment["$key"] = '';
1466- }
1467
1468 $query_string = '';
1469 foreach ( $comment as $key => $data )
1470 $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
1471-
1472- $commentdata['comment_as_submitted'] = $comment;
1473
1474 $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
1475 $commentdata['akismet_result'] = $response[1];
1476@@ -358,17 +517,10 @@
1477 // akismet_result_spam() won't be called so bump the counter here
1478 if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
1479 update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );
1480- wp_redirect( $_SERVER['HTTP_REFERER'] );
1481- die();
1482+ die;
1483 }
1484 }
1485
1486- // if the response is neither true nor false, hold the comment for moderation and schedule a recheck
1487- if ( 'true' != $response[1] && 'false' != $response[1] ) {
1488- add_filter('pre_comment_approved', 'akismet_result_hold');
1489- wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
1490- }
1491-
1492 if ( function_exists('wp_next_scheduled') && function_exists('wp_schedule_event') ) {
1493 // WP 2.1+: delete old comments daily
1494 if ( !wp_next_scheduled('akismet_scheduled_delete') )
1495@@ -377,25 +529,18 @@
1496 // WP 2.0: run this one time in ten
1497 akismet_delete_old();
1498 }
1499- $akismet_last_comment = $commentdata;
1500 return $commentdata;
1501 }
1502
1503-add_action('preprocess_comment', 'akismet_auto_check_comment', 1);
1504-
1505 function akismet_delete_old() {
1506 global $wpdb;
1507 $now_gmt = current_time('mysql', 1);
1508 $comment_ids = $wpdb->get_col("SELECT comment_id FROM $wpdb->comments WHERE DATE_SUB('$now_gmt', INTERVAL 15 DAY) > comment_date_gmt AND comment_approved = 'spam'");
1509 if ( empty( $comment_ids ) )
1510 return;
1511-
1512- $comma_comment_ids = implode( ', ', array_map('intval', $comment_ids) );
1513
1514 do_action( 'delete_comment', $comment_ids );
1515- $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_id IN ( $comma_comment_ids )");
1516- $wpdb->query("DELETE FROM $wpdb->commentmeta WHERE comment_id IN ( $comma_comment_ids )");
1517- clean_comment_cache( $comment_ids );
1518+ $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_id IN ( " . implode( ', ', $comment_ids ) . " )");
1519 $n = mt_rand(1, 5000);
1520 if ( apply_filters('akismet_optimize_table', ($n == 11)) ) // lucky number
1521 $wpdb->query("OPTIMIZE TABLE $wpdb->comments");
1522@@ -404,103 +549,341 @@
1523
1524 add_action('akismet_scheduled_delete', 'akismet_delete_old');
1525
1526-function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {
1527- global $wpdb, $akismet_api_host, $akismet_api_port;
1528-
1529- $id = (int) $id;
1530- $c = $wpdb->get_row( "SELECT * FROM $wpdb->comments WHERE comment_ID = '$id'", ARRAY_A );
1531- if ( !$c )
1532- return;
1533-
1534- $c['user_ip'] = $c['comment_author_IP'];
1535- $c['user_agent'] = $c['comment_agent'];
1536- $c['referrer'] = '';
1537- $c['blog'] = get_option('home');
1538- $c['blog_lang'] = get_locale();
1539- $c['blog_charset'] = get_option('blog_charset');
1540- $c['permalink'] = get_permalink($c['comment_post_ID']);
1541- $id = $c['comment_ID'];
1542- if ( akismet_test_mode() )
1543- $c['is_test'] = 'true';
1544- $c['recheck_reason'] = $recheck_reason;
1545-
1546- $query_string = '';
1547- foreach ( $c as $key => $data )
1548- $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
1549-
1550- $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
1551- return $response[1];
1552-}
1553-
1554-function akismet_cron_recheck() {
1555+function akismet_submit_nonspam_comment ( $comment_id ) {
1556+ global $wpdb, $akismet_api_host, $akismet_api_port, $current_user, $current_site;
1557+ $comment_id = (int) $comment_id;
1558+
1559+ $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'");
1560+ if ( !$comment ) // it was deleted
1561+ return;
1562+ $comment->blog = get_option('home');
1563+ $comment->blog_lang = get_locale();
1564+ $comment->blog_charset = get_option('blog_charset');
1565+ $comment->permalink = get_permalink($comment->comment_post_ID);
1566+ if ( is_object($current_user) ) {
1567+ $comment->reporter = $current_user->user_login;
1568+ }
1569+ if ( is_object($current_site) ) {
1570+ $comment->site_domain = $current_site->domain;
1571+ }
1572+
1573+ $comment->user_role = '';
1574+ if ( isset( $comment->user_ID ) )
1575+ $comment->user_role = akismet_get_user_roles($comment->user_ID);
1576+
1577+ $query_string = '';
1578+ foreach ( $comment as $key => $data )
1579+ $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
1580+
1581+ $response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-ham", $akismet_api_port);
1582+ do_action('akismet_submit_nonspam_comment', $comment_id, $response[1]);
1583+}
1584+
1585+function akismet_submit_spam_comment ( $comment_id ) {
1586+ global $wpdb, $akismet_api_host, $akismet_api_port, $current_user, $current_site;
1587+ $comment_id = (int) $comment_id;
1588+
1589+ $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'");
1590+ if ( !$comment ) // it was deleted
1591+ return;
1592+ if ( 'spam' != $comment->comment_approved )
1593+ return;
1594+ $comment->blog = get_option('home');
1595+ $comment->blog_lang = get_locale();
1596+ $comment->blog_charset = get_option('blog_charset');
1597+ $comment->permalink = get_permalink($comment->comment_post_ID);
1598+ if ( is_object($current_user) ) {
1599+ $comment->reporter = $current_user->user_login;
1600+ }
1601+ if ( is_object($current_site) ) {
1602+ $comment->site_domain = $current_site->domain;
1603+ }
1604+
1605+ $comment->user_role = '';
1606+ if ( !isset( $comment->user_id ) )
1607+ $comment->user_role = akismet_get_user_roles($comment->user_ID);
1608+
1609+ $query_string = '';
1610+ foreach ( $comment as $key => $data )
1611+ $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
1612+
1613+ $response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-spam", $akismet_api_port);
1614+ do_action('akismet_submit_spam_comment', $comment_id, $response[1]);
1615+}
1616+
1617+add_action('preprocess_comment', 'akismet_auto_check_comment', 1);
1618+
1619+// For old versions of WP only
1620+function akismet_set_comment_status( $comment_id, $status ) {
1621+ if ( $status == 'spam' ) {
1622+ akismet_submit_spam_comment( $comment_id );
1623+ } elseif ( $status == 'approve' ) {
1624+ akismet_submit_nonspam_comment( $comment_id );
1625+ }
1626+}
1627+
1628+// For WP 2.7+
1629+function akismet_transition_comment_status( $new_status, $old_status, $comment ) {
1630+ if ( $new_status == $old_status )
1631+ return;
1632+
1633+ if ( $new_status == 'spam' ) {
1634+ akismet_submit_spam_comment( $comment->comment_ID );
1635+ } elseif ( $old_status == 'spam' && ( $new_status == 'approved' || $new_status == 'unapproved' ) ) {
1636+ akismet_submit_nonspam_comment( $comment->comment_ID );
1637+ }
1638+}
1639+
1640+function akismet_spamtoham( $comment ) { akismet_submit_nonspam_comment( $comment->comment_ID ); }
1641+
1642+if ( function_exists( 'wp_transition_comment_status' ) ) {
1643+ add_action( 'transition_comment_status', 'akismet_transition_comment_status', 10, 3 );
1644+} else {
1645+ add_action('wp_set_comment_status', 'akismet_set_comment_status', 10, 2);
1646+ add_action('edit_comment', 'akismet_submit_spam_comment');
1647+ add_filter( 'comment_spam_to_approved', 'akismet_spamtoham' );
1648+ add_filter( 'comment_spam_to_unapproved', 'akismet_spamtoham' );
1649+}
1650+// Total spam in queue
1651+// get_option( 'akismet_spam_count' ) is the total caught ever
1652+function akismet_spam_count( $type = false ) {
1653 global $wpdb;
1654
1655- delete_option('akismet_available_servers');
1656-
1657- $comment_errors = $wpdb->get_col( "
1658- SELECT comment_id
1659- FROM {$wpdb->prefix}commentmeta
1660- WHERE meta_key = 'akismet_error'
1661- LIMIT 100
1662- " );
1663-
1664- foreach ( (array) $comment_errors as $comment_id ) {
1665- // if the comment no longer exists, remove the meta entry from the queue to avoid getting stuck
1666- if ( !get_comment( $comment_id ) ) {
1667- delete_comment_meta( $comment_id, 'akismet_error' );
1668- continue;
1669- }
1670-
1671- add_comment_meta( $comment_id, 'akismet_rechecking', true );
1672- $status = akismet_check_db_comment( $comment_id, 'retry' );
1673-
1674- $msg = '';
1675- if ( $status == 'true' ) {
1676- $msg = __( 'Akismet caught this comment as spam during an automatic retry.' );
1677- } elseif ( $status == 'false' ) {
1678- $msg = __( 'Akismet cleared this comment during an automatic retry.' );
1679- }
1680-
1681- // If we got back a legit response then update the comment history
1682- // other wise just bail now and try again later. No point in
1683- // re-trying all the comments once we hit one failure.
1684- if ( !empty( $msg ) ) {
1685- delete_comment_meta( $comment_id, 'akismet_error' );
1686- akismet_update_comment_history( $comment_id, $msg, 'cron-retry' );
1687- update_comment_meta( $comment_id, 'akismet_result', $status );
1688- // make sure the comment status is still pending. if it isn't, that means the user has already moved it elsewhere.
1689- $comment = get_comment( $comment_id );
1690- if ( $comment && 'unapproved' == wp_get_comment_status( $comment_id ) ) {
1691- if ( $status == 'true' ) {
1692- wp_spam_comment( $comment_id );
1693- } elseif ( $status == 'false' ) {
1694- // comment is good, but it's still in the pending queue. depending on the moderation settings
1695- // we may need to change it to approved.
1696- if ( check_comment($comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent, $comment->comment_type) )
1697- wp_set_comment_status( $comment_id, 1 );
1698- }
1699+ if ( !$type ) { // total
1700+ $count = wp_cache_get( 'akismet_spam_count', 'widget' );
1701+ if ( false === $count ) {
1702+ if ( function_exists('wp_count_comments') ) {
1703+ $count = wp_count_comments();
1704+ $count = $count->spam;
1705+ } else {
1706+ $count = (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam'");
1707 }
1708- } else {
1709- delete_comment_meta( $comment_id, 'akismet_rechecking' );
1710- wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
1711- return;
1712+ wp_cache_set( 'akismet_spam_count', $count, 'widget', 3600 );
1713 }
1714- }
1715+ return $count;
1716+ } elseif ( 'comments' == $type || 'comment' == $type ) { // comments
1717+ $type = '';
1718+ } else { // pingback, trackback, ...
1719+ $type = $wpdb->escape( $type );
1720+ }
1721+
1722+ return (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam' AND comment_type='$type'");
1723+}
1724+
1725+
1726+// WP 2.5+
1727+function akismet_rightnow() {
1728+ global $submenu, $wp_db_version;
1729+
1730+ // clean_url was deprecated in WP 3.0
1731+ $esc_url = 'clean_url';
1732+ if ( function_exists( 'esc_url' ) )
1733+ $esc_url = 'esc_url';
1734+
1735+ if ( 8645 < $wp_db_version ) // 2.7
1736+ $link = 'edit-comments.php?comment_status=spam';
1737+ elseif ( isset( $submenu['edit-comments.php'] ) )
1738+ $link = 'edit-comments.php?page=akismet-admin';
1739+ else
1740+ $link = 'edit.php?page=akismet-admin';
1741+
1742+ if ( $count = get_option('akismet_spam_count') ) {
1743+ $intro = sprintf( __ngettext(
1744+ '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already,',
1745+ '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already,',
1746+ $count
1747+ ), 'http://akismet.com/', number_format_i18n( $count ) );
1748+ } else {
1749+ $intro = sprintf( __('<a href="%1$s">Akismet</a> blocks spam from getting to your blog,'), 'http://akismet.com/' );
1750+ }
1751+
1752+ if ( $queue_count = akismet_spam_count() ) {
1753+ $queue_text = sprintf( __ngettext(
1754+ 'and there\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
1755+ 'and there are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
1756+ $queue_count
1757+ ), number_format_i18n( $queue_count ), clean_url($link) );
1758+ } else {
1759+ $queue_text = sprintf( __( "but there's nothing in your <a href='%1\$s'>spam queue</a> at the moment." ), $esc_url($link) );
1760+ }
1761+
1762+ // _c was deprecated in WP 2.9.0
1763+ if ( function_exists( '_x' ) )
1764+ $text = sprintf( _x( '%1$s %2$s', 'akismet_rightnow' ), $intro, $queue_text );
1765+ else
1766+ $text = sprintf( _c( '%1$s %2$s|akismet_rightnow' ), $intro, $queue_text );
1767+
1768+ echo "<p class='akismet-right-now'>$text</p>\n";
1769+}
1770
1771- $remaining = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->commentmeta WHERE meta_key = 'akismet_error'" ) );
1772- if ( $remaining && !wp_next_scheduled('akismet_schedule_cron_recheck') ) {
1773- wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
1774- }
1775-}
1776-add_action( 'akismet_schedule_cron_recheck', 'akismet_cron_recheck' );
1777-
1778-function akismet_add_comment_nonce( $post_id ) {
1779- echo '<p style="display: none;">';
1780- wp_nonce_field( 'akismet_comment_nonce_' . $post_id, 'akismet_comment_nonce', FALSE );
1781- echo '</p>';
1782-}
1783-
1784-$akismet_comment_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
1785-
1786-if ( $akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '' )
1787- add_action( 'comment_form', 'akismet_add_comment_nonce' );
1788+add_action('rightnow_end', 'akismet_rightnow');
1789+
1790+
1791+// For WP >= 2.5
1792+function akismet_check_for_spam_button($comment_status) {
1793+ if ( 'approved' == $comment_status )
1794+ return;
1795+ if ( function_exists('plugins_url') )
1796+ $link = 'admin.php?action=akismet_recheck_queue';
1797+ else
1798+ $link = 'edit-comments.php?page=akismet-admin&amp;recheckqueue=true&amp;noheader=true';
1799+ echo "</div><div class='alignleft'><a class='button-secondary checkforspam' href='$link'>" . __('Check for Spam') . "</a>";
1800+}
1801+add_action('manage_comments_nav', 'akismet_check_for_spam_button');
1802+
1803+function akismet_recheck_queue() {
1804+ global $wpdb, $akismet_api_host, $akismet_api_port;
1805+
1806+ if ( ! ( isset( $_GET['recheckqueue'] ) || ( isset( $_REQUEST['action'] ) && 'akismet_recheck_queue' == $_REQUEST['action'] ) ) )
1807+ return;
1808+
1809+ $moderation = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = '0'", ARRAY_A );
1810+ foreach ( (array) $moderation as $c ) {
1811+ $c['user_ip'] = $c['comment_author_IP'];
1812+ $c['user_agent'] = $c['comment_agent'];
1813+ $c['referrer'] = '';
1814+ $c['blog'] = get_option('home');
1815+ $c['blog_lang'] = get_locale();
1816+ $c['blog_charset'] = get_option('blog_charset');
1817+ $c['permalink'] = get_permalink($c['comment_post_ID']);
1818+
1819+ $c['user_role'] = '';
1820+ if ( isset( $c['user_ID'] ) )
1821+ $c['user_role'] = akismet_get_user_roles($c['user_ID']);
1822+
1823+ $id = (int) $c['comment_ID'];
1824+
1825+ $query_string = '';
1826+ foreach ( $c as $key => $data )
1827+ $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
1828+
1829+ $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
1830+ if ( 'true' == $response[1] ) {
1831+ if ( function_exists('wp_set_comment_status') )
1832+ wp_set_comment_status($id, 'spam');
1833+ else
1834+ $wpdb->query("UPDATE $wpdb->comments SET comment_approved = 'spam' WHERE comment_ID = $id");
1835+
1836+ }
1837+ }
1838+ wp_redirect( $_SERVER['HTTP_REFERER'] );
1839+ exit;
1840+}
1841+
1842+add_action('admin_action_akismet_recheck_queue', 'akismet_recheck_queue');
1843+
1844+function akismet_check_db_comment( $id ) {
1845+ global $wpdb, $akismet_api_host, $akismet_api_port;
1846+
1847+ $id = (int) $id;
1848+ $c = $wpdb->get_row( "SELECT * FROM $wpdb->comments WHERE comment_ID = '$id'", ARRAY_A );
1849+ if ( !$c )
1850+ return;
1851+
1852+ $c['user_ip'] = $c['comment_author_IP'];
1853+ $c['user_agent'] = $c['comment_agent'];
1854+ $c['referrer'] = '';
1855+ $c['blog'] = get_option('home');
1856+ $c['blog_lang'] = get_locale();
1857+ $c['blog_charset'] = get_option('blog_charset');
1858+ $c['permalink'] = get_permalink($c['comment_post_ID']);
1859+ $id = $c['comment_ID'];
1860+
1861+ $query_string = '';
1862+ foreach ( $c as $key => $data )
1863+ $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
1864+
1865+ $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
1866+ return $response[1];
1867+}
1868+
1869+// Widget stuff
1870+function widget_akismet_register() {
1871+ if ( function_exists('register_sidebar_widget') ) :
1872+ function widget_akismet($args) {
1873+ extract($args);
1874+ $options = get_option('widget_akismet');
1875+ $count = number_format_i18n(get_option('akismet_spam_count'));
1876+ ?>
1877+ <?php echo $before_widget; ?>
1878+ <?php echo $before_title . $options['title'] . $after_title; ?>
1879+ <div id="akismetwrap"><div id="akismetstats"><a id="aka" href="http://akismet.com" title=""><?php printf( __( '%1$s %2$sspam comments%3$s %4$sblocked by%5$s<br />%6$sAkismet%7$s' ), '<span id="akismet1"><span id="akismetcount">' . $count . '</span>', '<span id="akismetsc">', '</span></span>', '<span id="akismet2"><span id="akismetbb">', '</span>', '<span id="akismeta">', '</span></span>' ); ?></a></div></div>
1880+ <?php echo $after_widget; ?>
1881+ <?php
1882+ }
1883+
1884+ function widget_akismet_style() {
1885+ $plugin_dir = '/wp-content/plugins';
1886+ if ( defined( 'PLUGINDIR' ) )
1887+ $plugin_dir = '/' . PLUGINDIR;
1888+
1889+ ?>
1890+<style type="text/css">
1891+#aka,#aka:link,#aka:hover,#aka:visited,#aka:active{color:#fff;text-decoration:none}
1892+#aka:hover{border:none;text-decoration:none}
1893+#aka:hover #akismet1{display:none}
1894+#aka:hover #akismet2,#akismet1{display:block}
1895+#akismet2{display:none;padding-top:2px}
1896+#akismeta{font-size:16px;font-weight:bold;line-height:18px;text-decoration:none}
1897+#akismetcount{display:block;font:15px Verdana,Arial,Sans-Serif;font-weight:bold;text-decoration:none}
1898+#akismetwrap #akismetstats{background:url(<?php echo get_option('siteurl'), $plugin_dir; ?>/akismet/akismet.gif) no-repeat top left;border:none;color:#fff;font:11px 'Trebuchet MS','Myriad Pro',sans-serif;height:40px;line-height:100%;overflow:hidden;padding:8px 0 0;text-align:center;width:120px}
1899+</style>
1900+ <?php
1901+ }
1902+
1903+ function widget_akismet_control() {
1904+ $options = $newoptions = get_option('widget_akismet');
1905+ if ( isset( $_POST['akismet-submit'] ) && $_POST["akismet-submit"] ) {
1906+ $newoptions['title'] = strip_tags(stripslashes($_POST["akismet-title"]));
1907+ if ( empty($newoptions['title']) ) $newoptions['title'] = __('Spam Blocked');
1908+ }
1909+ if ( $options != $newoptions ) {
1910+ $options = $newoptions;
1911+ update_option('widget_akismet', $options);
1912+ }
1913+ $title = htmlspecialchars($options['title'], ENT_QUOTES);
1914+ ?>
1915+ <p><label for="akismet-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="akismet-title" name="akismet-title" type="text" value="<?php echo $title; ?>" /></label></p>
1916+ <input type="hidden" id="akismet-submit" name="akismet-submit" value="1" />
1917+ <?php
1918+ }
1919+
1920+ if ( function_exists( 'wp_register_sidebar_widget' ) ) {
1921+ wp_register_sidebar_widget( 'akismet', 'Akismet', 'widget_akismet', null, 'akismet');
1922+ wp_register_widget_control( 'akismet', 'Akismet', 'widget_akismet_control', null, 75, 'akismet');
1923+ } else {
1924+ register_sidebar_widget('Akismet', 'widget_akismet', null, 'akismet');
1925+ register_widget_control('Akismet', 'widget_akismet_control', null, 75, 'akismet');
1926+ }
1927+ if ( is_active_widget('widget_akismet') )
1928+ add_action('wp_head', 'widget_akismet_style');
1929+ endif;
1930+}
1931+
1932+add_action('init', 'widget_akismet_register');
1933+
1934+// Counter for non-widget users
1935+function akismet_counter() {
1936+ $plugin_dir = '/wp-content/plugins';
1937+ if ( defined( 'PLUGINDIR' ) )
1938+ $plugin_dir = '/' . PLUGINDIR;
1939+
1940+?>
1941+<style type="text/css">
1942+#akismetwrap #aka,#aka:link,#aka:hover,#aka:visited,#aka:active{color:#fff;text-decoration:none}
1943+#aka:hover{border:none;text-decoration:none}
1944+#aka:hover #akismet1{display:none}
1945+#aka:hover #akismet2,#akismet1{display:block}
1946+#akismet2{display:none;padding-top:2px}
1947+#akismeta{font-size:16px;font-weight:bold;line-height:18px;text-decoration:none}
1948+#akismetcount{display:block;font:15px Verdana,Arial,Sans-Serif;font-weight:bold;text-decoration:none}
1949+#akismetwrap #akismetstats{background:url(<?php echo get_option('siteurl'), $plugin_dir; ?>/akismet/akismet.gif) no-repeat top left;border:none;color:#fff;font:11px 'Trebuchet MS','Myriad Pro',sans-serif;height:40px;line-height:100%;overflow:hidden;padding:8px 0 0;text-align:center;width:120px}
1950+</style>
1951+<?php
1952+$count = number_format_i18n(get_option('akismet_spam_count'));
1953+?>
1954+<div id="akismetwrap"><div id="akismetstats"><a id="aka" href="http://akismet.com" title=""><div id="akismet1"><span id="akismetcount"><?php echo $count; ?></span> <span id="akismetsc"><?php _e('spam comments') ?></span></div> <div id="akismet2"><span id="akismetbb"><?php _e('blocked by') ?></span><br /><span id="akismeta">Akismet</span></div></a></div></div>
1955+<?php
1956+}
1957+
1958+?>
1959
1960=== modified file 'wp-content/plugins/akismet/readme.txt'
1961--- wp-content/plugins/akismet/readme.txt 2011-01-25 15:58:41 +0000
1962+++ wp-content/plugins/akismet/readme.txt 2011-02-18 16:29:18 +0000
1963@@ -1,9 +1,9 @@
1964 === Akismet ===
1965-Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, automattic
1966+Contributors: matt, ryan, andy, mdawaffe, tellyworth, automattic
1967 Tags: akismet, comments, spam
1968-Requires at least: 3.0
1969-Tested up to: 3.1
1970-Stable tag: 2.5.2
1971+Requires at least: 2.0
1972+Tested up to: 3.0
1973+Stable tag: 2.4.0
1974 License: GPLv2
1975
1976 Akismet checks your comments against the Akismet web service to see if they look like spam or not.
1977@@ -13,15 +13,11 @@
1978 Akismet checks your comments against the Akismet web service to see if they look like spam or not and lets you
1979 review the spam it catches under your blog's "Comments" admin screen.
1980
1981-Major new features in Akismet 2.5 include:
1982-
1983-* A comment status history, so you can easily see which comments were caught or cleared by Akismet, and which were spammed or unspammed by a moderator
1984-* Links are highlighted in the comment body, to reveal hidden or misleading links
1985-* If your web host is unable to reach Akismet's servers, the plugin will automatically retry when your connection is back up
1986-* Moderators can see the number of approved comments for each user
1987-* Spam and Unspam reports now include more information, to help improve accuracy
1988-
1989-PS: You'll need an [Akismet.com API key](http://akismet.com/get/) to use it. Keys are free for personal blogs, with paid subscriptions available for businesses and commercial sites.
1990+Want to show off how much spam Akismet has caught for you? Just put `<?php akismet_counter(); ?>` in your template.
1991+
1992+See also: [WP Stats plugin](http://wordpress.org/extend/plugins/stats/).
1993+
1994+PS: You'll need an [Akismet.com API key](http://akismet.com/get/) to use it.
1995
1996 == Installation ==
1997
1998@@ -31,48 +27,6 @@
1999
2000 == Changelog ==
2001
2002-= 2.5.2 =
2003-
2004-* Properly format the comment count for author counts
2005-* Look for super admins on multisite installs when looking up user roles
2006-* Increase the HTTP request timeout
2007-* Removed padding for author approved count
2008-* Fix typo in function name
2009-* Set Akismet stats iframe height to fixed 2500px. Better to have one tall scroll bar than two side by side.
2010-
2011-= 2.5.1 =
2012-
2013-* Fix a bug that caused the "Auto delete" option to fail to discard comments correctly
2014-* Remove the comment nonce form field from the 'Akismet Configuration' page in favor of using a filter, akismet_comment_nonce
2015-* Fixed padding bug in "author" column of posts screen
2016-* Added margin-top to "cleared by ..." badges on dashboard
2017-* Fix possible error when calling akismet_cron_recheck()
2018-* Fix more PHP warnings
2019-* Clean up XHTML warnings for comment nonce
2020-* Fix for possible condition where scheduled comment re-checks could get stuck
2021-* Clean up the comment meta details after deleting a comment
2022-* Only show the status badge if the comment status has been changed by someone/something other than Akismet
2023-* Show a 'History' link in the row-actions
2024-* Translation fixes
2025-* Reduced font-size on author name
2026-* Moved "flagged by..." notification to top right corner of comment container and removed heavy styling
2027-* Hid "flagged by..." notification while on dashboard
2028-
2029-= 2.5.0 =
2030-
2031-* Track comment actions under 'Akismet Status' on the edit comment screen
2032-* Fix a few remaining deprecated function calls ( props Mike Glendinning )
2033-* Use HTTPS for the stats IFRAME when wp-admin is using HTTPS
2034-* Use the WordPress HTTP class if available
2035-* Move the admin UI code to a separate file, only loaded when needed
2036-* Add cron retry feature, to replace the old connectivity check
2037-* Display Akismet status badge beside each comment
2038-* Record history for each comment, and display it on the edit page
2039-* Record the complete comment as originally submitted in comment_meta, to use when reporting spam and ham
2040-* Highlight links in comment content
2041-* New option, "Show the number of comments you've approved beside each comment author."
2042-* New option, "Use a nonce on the comment form."
2043-
2044 = 2.4.0 =
2045
2046 * Spell out that the license is GPLv2
2047
2048=== modified file 'wp-content/themes/twentyten/languages/twentyten.pot'
2049--- wp-content/themes/twentyten/languages/twentyten.pot 2011-01-25 15:27:25 +0000
2050+++ wp-content/themes/twentyten/languages/twentyten.pot 2011-02-18 16:29:18 +0000
2051@@ -1,122 +1,53 @@
2052-# Translation of the WordPress theme Twenty Ten 1.1 by the WordPress team.
2053-# Copyright (C) 2010 the WordPress team
2054+# Copyright (C) 2010 Twenty Ten
2055 # This file is distributed under the same license as the Twenty Ten package.
2056-# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
2057-#
2058-#, fuzzy
2059 msgid ""
2060 msgstr ""
2061 "Project-Id-Version: Twenty Ten 1.1\n"
2062 "Report-Msgid-Bugs-To: http://wordpress.org/tag/twentyten\n"
2063-"POT-Creation-Date: 2010-07-14 16:21+0000\n"
2064+"POT-Creation-Date: 2011-01-01 21:26:51+00:00\n"
2065+"MIME-Version: 1.0\n"
2066+"Content-Type: text/plain; charset=UTF-8\n"
2067+"Content-Transfer-Encoding: 8bit\n"
2068 "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
2069 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
2070 "Language-Team: LANGUAGE <LL@li.org>\n"
2071-"MIME-Version: 1.0\n"
2072-"Content-Type: text/plain; charset=utf-8\n"
2073-"Content-Transfer-Encoding: 8bit\n"
2074-"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
2075-
2076-#: 404.php:16 loop.php:33
2077-msgid "Not Found"
2078-msgstr ""
2079-
2080-#: 404.php:18
2081-msgid ""
2082-"Apologies, but the page you requested could not be found. Perhaps searching "
2083-"will help."
2084-msgstr ""
2085-
2086-#: archive.php:33
2087-#, php-format
2088-msgid "Daily Archives: <span>%s</span>"
2089-msgstr ""
2090-
2091-#: archive.php:35
2092-#, php-format
2093-msgid "Monthly Archives: <span>%s</span>"
2094-msgstr ""
2095-
2096-#: archive.php:37
2097-#, php-format
2098-msgid "Yearly Archives: <span>%s</span>"
2099-msgstr ""
2100-
2101-#: archive.php:39
2102-msgid "Blog Archives"
2103-msgstr ""
2104-
2105-#: attachment.php:18
2106-#, php-format
2107-msgid "Return to %s"
2108-msgstr ""
2109-
2110-#. translators: %s - title of parent post
2111-#: attachment.php:20
2112-#, php-format
2113-msgid "<span class=\"meta-nav\">&larr;</span> %s"
2114-msgstr ""
2115-
2116-#: attachment.php:29
2117-#, php-format
2118-msgid "<span class=\"%1$s\">By</span> %2$s"
2119-msgstr ""
2120-
2121-#: attachment.php:33 functions.php:451
2122-#, php-format
2123-msgid "View all posts by %s"
2124-msgstr ""
2125-
2126-#: attachment.php:40
2127-#, php-format
2128-msgid "<span class=\"%1$s\">Published</span> %2$s"
2129-msgstr ""
2130-
2131-#: attachment.php:50
2132-#, php-format
2133-msgid "Full size is %s pixels"
2134-msgstr ""
2135-
2136-#: attachment.php:53
2137-msgid "Link to full-size image"
2138-msgstr ""
2139-
2140-#: attachment.php:60 attachment.php:107 loop.php:95 loop.php:118 loop.php:160
2141-#: onecolumn-page.php:27 page.php:32 single.php:53
2142-msgid "Edit"
2143-msgstr ""
2144-
2145-#: attachment.php:100 functions.php:241 loop.php:110 loop.php:138
2146-msgid "Continue reading <span class=\"meta-nav\">&rarr;</span>"
2147-msgstr ""
2148-
2149-#: attachment.php:101 loop.php:139 onecolumn-page.php:26 page.php:31
2150-#: single.php:31
2151-msgid "Pages:"
2152-msgstr ""
2153-
2154-#: author.php:27
2155-#, php-format
2156-msgid "Author Archives: %s"
2157-msgstr ""
2158-
2159-#: author.php:37 single.php:40
2160-#, php-format
2161-msgid "About %s"
2162+
2163+#. #-#-#-#-# twentyten.pot (Twenty Ten 1.1) #-#-#-#-#
2164+#. Theme URI of the plugin/theme
2165+#: footer.php:33
2166+msgid "http://wordpress.org/"
2167+msgstr ""
2168+
2169+#: footer.php:34
2170+msgid "Semantic Personal Publishing Platform"
2171+msgstr ""
2172+
2173+#: footer.php:35
2174+msgid "Proudly powered by %s."
2175 msgstr ""
2176
2177 #: category.php:16
2178-#, php-format
2179 msgid "Category Archives: %s"
2180 msgstr ""
2181
2182+#: sidebar.php:27
2183+msgid "Archives"
2184+msgstr ""
2185+
2186+#: sidebar.php:34
2187+msgid "Meta"
2188+msgstr ""
2189+
2190+#: tag.php:16
2191+msgid "Tag Archives: %s"
2192+msgstr ""
2193+
2194 #: comments.php:18
2195 msgid ""
2196 "This post is password protected. Enter the password to view any comments."
2197 msgstr ""
2198
2199 #: comments.php:35
2200-#, php-format
2201 msgid "One Response to %2$s"
2202 msgid_plural "%1$s Responses to %2$s"
2203 msgstr[0] ""
2204@@ -134,67 +65,127 @@
2205 msgid "Comments are closed."
2206 msgstr ""
2207
2208-#. #-#-#-#-# twentyten.pot (Twenty Ten 1.1) #-#-#-#-#
2209-#. Theme URI of the plugin/theme
2210-#: footer.php:33
2211-msgid "http://wordpress.org/"
2212-msgstr ""
2213-
2214-#: footer.php:34
2215-msgid "Semantic Personal Publishing Platform"
2216-msgstr ""
2217-
2218-#: footer.php:35
2219-#, php-format
2220-msgid "Proudly powered by %s."
2221+#: 404.php:16 loop.php:33
2222+msgid "Not Found"
2223+msgstr ""
2224+
2225+#: 404.php:18
2226+msgid ""
2227+"Apologies, but the page you requested could not be found. Perhaps searching "
2228+"will help."
2229+msgstr ""
2230+
2231+#: loop.php:25 loop.php:173
2232+msgid "<span class=\"meta-nav\">&larr;</span> Older posts"
2233+msgstr ""
2234+
2235+#: loop.php:26 loop.php:174
2236+msgid "Newer posts <span class=\"meta-nav\">&rarr;</span>"
2237+msgstr ""
2238+
2239+#: loop.php:35
2240+msgid ""
2241+"Apologies, but no results were found for the requested archive. Perhaps "
2242+"searching will help find a related post."
2243+msgstr ""
2244+
2245+#: loop.php:60 loop.php:92
2246+msgctxt "gallery category slug"
2247+msgid "gallery"
2248+msgstr ""
2249+
2250+#: loop.php:62 loop.php:83 loop.php:126
2251+msgid "Permalink to %s"
2252+msgstr ""
2253+
2254+#: loop.php:82
2255+msgid "This gallery contains <a %1$s>%2$s photos</a>."
2256+msgstr ""
2257+
2258+#: loop.php:92
2259+msgid "View posts in the Gallery category"
2260+msgstr ""
2261+
2262+#: loop.php:92
2263+msgid "More Galleries"
2264+msgstr ""
2265+
2266+#: loop.php:94 loop.php:117 loop.php:159
2267+msgid "Leave a comment"
2268+msgstr ""
2269+
2270+#: loop.php:94 loop.php:117 loop.php:159
2271+msgid "1 Comment"
2272+msgstr ""
2273+
2274+#: loop.php:94 loop.php:117 loop.php:159
2275+msgid "% Comments"
2276+msgstr ""
2277+
2278+#: loop.php:95 loop.php:118 loop.php:160 page.php:32 attachment.php:60
2279+#: attachment.php:107 onecolumn-page.php:27 single.php:53
2280+msgid "Edit"
2281+msgstr ""
2282+
2283+#: loop.php:101
2284+msgctxt "asides category slug"
2285+msgid "asides"
2286+msgstr ""
2287+
2288+#: loop.php:110 loop.php:138 functions.php:241 attachment.php:100
2289+msgid "Continue reading <span class=\"meta-nav\">&rarr;</span>"
2290+msgstr ""
2291+
2292+#: loop.php:139 page.php:31 attachment.php:101 onecolumn-page.php:26
2293+#: single.php:31
2294+msgid "Pages:"
2295+msgstr ""
2296+
2297+#: loop.php:146
2298+msgid "<span class=\"%1$s\">Posted in</span> %2$s"
2299+msgstr ""
2300+
2301+#: loop.php:155
2302+msgid "<span class=\"%1$s\">Tagged</span> %2$s"
2303 msgstr ""
2304
2305 #: functions.php:97
2306 msgid "Primary Navigation"
2307 msgstr ""
2308
2309-#. translators: header image description
2310 #: functions.php:133
2311 msgid "Berries"
2312 msgstr ""
2313
2314-#. translators: header image description
2315 #: functions.php:139
2316 msgid "Cherry Blossoms"
2317 msgstr ""
2318
2319-#. translators: header image description
2320 #: functions.php:145
2321 msgid "Concave"
2322 msgstr ""
2323
2324-#. translators: header image description
2325 #: functions.php:151
2326 msgid "Fern"
2327 msgstr ""
2328
2329-#. translators: header image description
2330 #: functions.php:157
2331 msgid "Forest Floor"
2332 msgstr ""
2333
2334-#. translators: header image description
2335 #: functions.php:163
2336 msgid "Inkwell"
2337 msgstr ""
2338
2339-#. translators: header image description
2340 #: functions.php:169
2341 msgid "Path"
2342 msgstr ""
2343
2344-#. translators: header image description
2345 #: functions.php:175
2346 msgid "Sunset"
2347 msgstr ""
2348
2349 #: functions.php:308
2350-#, php-format
2351 msgid "%s <span class=\"says\">says:</span>"
2352 msgstr ""
2353
2354@@ -202,9 +193,7 @@
2355 msgid "Your comment is awaiting moderation."
2356 msgstr ""
2357
2358-#. translators: 1: date, 2: time
2359 #: functions.php:318
2360-#, php-format
2361 msgid "%1$s at %2$s"
2362 msgstr ""
2363
2364@@ -265,35 +254,34 @@
2365 msgstr ""
2366
2367 #: functions.php:442
2368-#, php-format
2369 msgid ""
2370 "<span class=\"%1$s\">Posted on</span> %2$s <span class=\"meta-sep\">by</"
2371 "span> %3$s"
2372 msgstr ""
2373
2374+#: functions.php:451 attachment.php:33
2375+msgid "View all posts by %s"
2376+msgstr ""
2377+
2378 #: functions.php:468
2379-#, php-format
2380 msgid ""
2381 "This entry was posted in %1$s and tagged %2$s. Bookmark the <a href=\"%3$s\" "
2382 "title=\"Permalink to %4$s\" rel=\"bookmark\">permalink</a>."
2383 msgstr ""
2384
2385 #: functions.php:470
2386-#, php-format
2387 msgid ""
2388 "This entry was posted in %1$s. Bookmark the <a href=\"%3$s\" title="
2389 "\"Permalink to %4$s\" rel=\"bookmark\">permalink</a>."
2390 msgstr ""
2391
2392 #: functions.php:472
2393-#, php-format
2394 msgid ""
2395 "Bookmark the <a href=\"%3$s\" title=\"Permalink to %4$s\" rel=\"bookmark"
2396 "\">permalink</a>."
2397 msgstr ""
2398
2399 #: header.php:33
2400-#, php-format
2401 msgid "Page %s"
2402 msgstr ""
2403
2404@@ -301,72 +289,39 @@
2405 msgid "Skip to content"
2406 msgstr ""
2407
2408-#: loop.php:25 loop.php:173
2409-msgid "<span class=\"meta-nav\">&larr;</span> Older posts"
2410-msgstr ""
2411-
2412-#: loop.php:26 loop.php:174
2413-msgid "Newer posts <span class=\"meta-nav\">&rarr;</span>"
2414-msgstr ""
2415-
2416-#: loop.php:35
2417-msgid ""
2418-"Apologies, but no results were found for the requested archive. Perhaps "
2419-"searching will help find a related post."
2420-msgstr ""
2421-
2422-#: loop.php:60 loop.php:92
2423-msgctxt "gallery category slug"
2424-msgid "gallery"
2425-msgstr ""
2426-
2427-#: loop.php:62 loop.php:83 loop.php:126
2428-#, php-format
2429-msgid "Permalink to %s"
2430-msgstr ""
2431-
2432-#: loop.php:82
2433-#, php-format
2434-msgid "This gallery contains <a %1$s>%2$s photos</a>."
2435-msgstr ""
2436-
2437-#: loop.php:92
2438-msgid "View posts in the Gallery category"
2439-msgstr ""
2440-
2441-#: loop.php:92
2442-msgid "More Galleries"
2443-msgstr ""
2444-
2445-#: loop.php:94 loop.php:117 loop.php:159
2446-msgid "Leave a comment"
2447-msgstr ""
2448-
2449-#: loop.php:94 loop.php:117 loop.php:159
2450-msgid "1 Comment"
2451-msgstr ""
2452-
2453-#: loop.php:94 loop.php:117 loop.php:159
2454-msgid "% Comments"
2455-msgstr ""
2456-
2457-#: loop.php:101
2458-msgctxt "asides category slug"
2459-msgid "asides"
2460-msgstr ""
2461-
2462-#: loop.php:146
2463-#, php-format
2464-msgid "<span class=\"%1$s\">Posted in</span> %2$s"
2465-msgstr ""
2466-
2467-#: loop.php:155
2468-#, php-format
2469-msgid "<span class=\"%1$s\">Tagged</span> %2$s"
2470+#: author.php:27
2471+msgid "Author Archives: %s"
2472+msgstr ""
2473+
2474+#: author.php:37 single.php:40
2475+msgid "About %s"
2476+msgstr ""
2477+
2478+#: attachment.php:18
2479+msgid "Return to %s"
2480+msgstr ""
2481+
2482+#: attachment.php:20
2483+msgid "<span class=\"meta-nav\">&larr;</span> %s"
2484+msgstr ""
2485+
2486+#: attachment.php:29
2487+msgid "<span class=\"%1$s\">By</span> %2$s"
2488+msgstr ""
2489+
2490+#: attachment.php:40
2491+msgid "<span class=\"%1$s\">Published</span> %2$s"
2492+msgstr ""
2493+
2494+#: attachment.php:50
2495+msgid "Full size is %s pixels"
2496+msgstr ""
2497+
2498+#: attachment.php:53
2499+msgid "Link to full-size image"
2500 msgstr ""
2501
2502 #: search.php:16
2503-#, php-format
2504 msgid "Search Results for: %s"
2505 msgstr ""
2506
2507@@ -380,12 +335,20 @@
2508 "different keywords."
2509 msgstr ""
2510
2511-#: sidebar.php:27
2512-msgid "Archives"
2513-msgstr ""
2514-
2515-#: sidebar.php:34
2516-msgid "Meta"
2517+#: archive.php:33
2518+msgid "Daily Archives: <span>%s</span>"
2519+msgstr ""
2520+
2521+#: archive.php:35
2522+msgid "Monthly Archives: <span>%s</span>"
2523+msgstr ""
2524+
2525+#: archive.php:37
2526+msgid "Yearly Archives: <span>%s</span>"
2527+msgstr ""
2528+
2529+#: archive.php:39
2530+msgid "Blog Archives"
2531 msgstr ""
2532
2533 #: single.php:18 single.php:58
2534@@ -399,15 +362,9 @@
2535 msgstr ""
2536
2537 #: single.php:44
2538-#, php-format
2539 msgid "View all posts by %s <span class=\"meta-nav\">&rarr;</span>"
2540 msgstr ""
2541
2542-#: tag.php:16
2543-#, php-format
2544-msgid "Tag Archives: %s"
2545-msgstr ""
2546-
2547 #. Theme Name of the plugin/theme
2548 msgid "Twenty Ten"
2549 msgstr ""
2550
2551=== modified file 'wp-includes/default-filters.php'
2552--- wp-includes/default-filters.php 2011-01-25 15:27:25 +0000
2553+++ wp-includes/default-filters.php 2011-02-18 16:29:18 +0000
2554@@ -31,8 +31,8 @@
2555 add_filter( $filter, 'wp_filter_kses' );
2556 }
2557
2558-// Kses only for textarea saves displays
2559-foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description' ) as $filter ) {
2560+// Kses only for textarea admin displays
2561+foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description', 'comment_text' ) as $filter ) {
2562 add_filter( $filter, 'wp_kses_data' );
2563 }
2564
2565@@ -73,6 +73,9 @@
2566 foreach ( array( 'pre_post_type' ) as $filter ) {
2567 add_filter( $filter, 'sanitize_user' );
2568 }
2569+foreach ( array( 'pre_post_status', 'pre_post_comment_status', 'pre_post_ping_status' ) as $filter ) {
2570+ add_filter( $filter, 'sanitize_key' );
2571+}
2572
2573 // Places to balance tags on input
2574 foreach ( array( 'content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content' ) as $filter ) {
2575
2576=== modified file 'wp-includes/kses.php'
2577--- wp-includes/kses.php 2011-01-25 15:50:12 +0000
2578+++ wp-includes/kses.php 2011-02-18 16:29:18 +0000
2579@@ -1,26 +1,33 @@
2580 <?php
2581 /**
2582- * HTML/XHTML filter that only allows some elements and attributes
2583+ * kses 0.2.2 - HTML/XHTML filter that only allows some elements and attributes
2584+ * Copyright (C) 2002, 2003, 2005 Ulf Harnhammar
2585+ *
2586+ * This program is free software and open source software; you can redistribute
2587+ * it and/or modify it under the terms of the GNU General Public License as
2588+ * published by the Free Software Foundation; either version 2 of the License,
2589+ * or (at your option) any later version.
2590+ *
2591+ * This program is distributed in the hope that it will be useful, but WITHOUT
2592+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2593+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
2594+ * more details.
2595+ *
2596+ * You should have received a copy of the GNU General Public License along
2597+ * with this program; if not, write to the Free Software Foundation, Inc.,
2598+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or visit
2599+ * http://www.gnu.org/licenses/gpl.html
2600+ *
2601+ * [kses strips evil scripts!]
2602 *
2603 * Added wp_ prefix to avoid conflicts with existing kses users
2604 *
2605 * @version 0.2.2
2606 * @copyright (C) 2002, 2003, 2005
2607- * @author Ulf Harnhammar <metaur@users.sourceforge.net>
2608+ * @author Ulf Harnhammar <http://advogato.org/person/metaur/>
2609 *
2610 * @package External
2611 * @subpackage KSES
2612- *
2613- * @internal
2614- * *** CONTACT INFORMATION ***
2615- * E-mail: metaur at users dot sourceforge dot net
2616- * Web page: http://sourceforge.net/projects/kses
2617- * Paper mail: Ulf Harnhammar
2618- * Ymergatan 17 C
2619- * 753 25 Uppsala
2620- * SWEDEN
2621- *
2622- * [kses strips evil scripts!]
2623 */
2624
2625 /**
2626
2627=== modified file 'wp-includes/pluggable.php'
2628--- wp-includes/pluggable.php 2011-01-25 15:27:25 +0000
2629+++ wp-includes/pluggable.php 2011-02-18 16:29:18 +0000
2630@@ -825,7 +825,7 @@
2631 $adminurl = strtolower(admin_url());
2632 $referer = strtolower(wp_get_referer());
2633 $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
2634- if ( !$result && !(-1 == $action && strpos($referer, $adminurl) !== false) ) {
2635+ if ( !$result && !(-1 == $action && strpos($referer, $adminurl) === 0) ) {
2636 wp_nonce_ays($action);
2637 die();
2638 }
2639
2640=== modified file 'wp-includes/script-loader.php'
2641--- wp-includes/script-loader.php 2011-01-25 15:27:25 +0000
2642+++ wp-includes/script-loader.php 2011-02-18 16:29:18 +0000
2643@@ -275,7 +275,7 @@
2644 $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20091012' );
2645 $scripts->add_data( 'postbox', 'group', 1 );
2646
2647- $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20100526' );
2648+ $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20110203' );
2649 $scripts->add_data( 'post', 'group', 1 );
2650 $scripts->localize( 'post', 'postL10n', array(
2651 'tagsUsed' => __('Tags used on this post:'),
2652
2653=== modified file 'wp-includes/version.php'
2654--- wp-includes/version.php 2011-01-25 15:50:12 +0000
2655+++ wp-includes/version.php 2011-02-18 16:29:18 +0000
2656@@ -1,14 +1,28 @@
2657 <?php
2658-/**
2659- * This holds the version number in a separate file so we can bump it without cluttering the SVN
2660- */
2661+/*
2662+WordPress - Web publishing software
2663+
2664+This program is free software; you can redistribute it and/or
2665+modify it under the terms of the GNU General Public License
2666+as published by the Free Software Foundation; either version 2
2667+of the License, or (at your option) any later version.
2668+
2669+This program is distributed in the hope that it will be useful,
2670+but WITHOUT ANY WARRANTY; without even the implied warranty of
2671+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2672+GNU General Public License for more details.
2673+
2674+You should have received a copy of the GNU General Public License
2675+along with this program; if not, write to the Free Software
2676+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2677+*/
2678
2679 /**
2680 * The WordPress version string
2681 *
2682 * @global string $wp_version
2683 */
2684-$wp_version = '3.0.4';
2685+$wp_version = '3.0.5';
2686
2687 /**
2688 * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

Subscribers

People subscribed via source and target branches