]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-content/plugins/akismet/_inc/akismet.js
WordPress 4.1
[autoinstalls/wordpress.git] / wp-content / plugins / akismet / _inc / akismet.js
index aa0aab42866530623d0dee0a9b145d14671782c6..7da76cd52e0bef9bd6afabf627cdd3b12e1d694b 100644 (file)
@@ -18,7 +18,7 @@ jQuery( function ( $ ) {
                var thisId = $(this).attr('commentid');
                $(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
        });
-       $('#the-comment-list').find('tr.comment, tr[id ^= "comment-"]').find('.column-author a[title ^= "http://"]').each(function () {
+       $('#the-comment-list').find('tr.comment, tr[id ^= "comment-"]').find('.column-author a[title ^= "http://"], .column-author a[title ^= "https://"]').each(function () {
                var thisTitle = $(this).attr('title');
                        thisCommentId = $(this).parents('tr:first').attr('id').split("-");
 
@@ -72,7 +72,7 @@ jQuery( function ( $ ) {
        });
        $('.akismet_undo_link_removal').live('click', function () {
                var thisId = $(this).attr('cid');
-               var thisUrl = $(this).attr('href').replace("http://www.", "").replace("http://", "");
+               var thisUrl = $(this).attr('href');
                var data = {
                        action: 'comment_author_reurl',
                        _wpnonce: WPAkismet.comment_author_url_nonce,
@@ -91,8 +91,8 @@ jQuery( function ( $ ) {
                                if (response) {
                                        // Add "x" link
                                        $("a[commentid='"+ thisId +"']").show();
-                                       // Show link
-                                       $("#author_comment_url_"+ thisId).removeClass('akismet_undo_link_removal').html(thisUrl);
+                                       // Show link. Core strips leading http://, so let's do that too.
+                                       $("#author_comment_url_"+ thisId).removeClass('akismet_undo_link_removal').text( thisUrl.replace( /^http:\/\/(www\.)?/ig, '' ) );
                                }
                        }
                });