MP-WP Patch for Enabling HTML Comments

March 25th, 2019

...among other innocuous tags like bold, blockquote, and so forth.

This patch implements Daniel P. Barron's simple fix. Also included is a revision of the trilema-specific database interaction in wp-comments-post.php to the default wp_comments table as pointed out by diana_coman.

*Edit March 26th 2019: My first regrind was still fucked up, as Daniel P. Barron graciously pointed out yet again. I've reground again using correct syntax. So then:

The secondly-reground patch:
mp-wp_html-comments-regrind.vpatch

The corresponding sig:
mp-wp_html-comments-regrind.vpatch.hanbot.sig

---fuxed files, for posterior---

*Edit March 25th 2019: I've reground this patch based on Daniel P. Barron's catch of my incorrect use of a default rather than a variable table name. The reground versions are:

Reground patch:
mp-wp_html-comments-fixed.vpatch

Reground sig:
mp-wp_html-comments-fixed.vpatch.hanbot.sig

The old patch:
mp-wp_html-comments-enabled.vpatch

My old sig:
mp-wp_html-comments-enabled.vpatch.hanbot.sig

Grab my pubkey, if needed, on the about page, or send !!key hanbot to deedbot on Freenode IRC, while ye may.

3 Responses to “MP-WP Patch for Enabling HTML Comments”

  1. +$myrows = $wpdb->get_var('SELECT comment_ID FROM wp_comments WHERE comment_author_IP = "'.$_SERVER["REMOTE_ADDR"].'" and comment_approved = "spam";');

    Your "wp_comments" is something that you personally chose when you installed your mp-wp. I happen to have chosen something different, and therefor this patch would break my installation. Diana had suggested that you use the variable "$wpdb->comments" instead, which would work no matter what name was chosen for the database table.

  2. hanbot says:

    Thank you for catching this. Reground.

  3. +$myrows = $wpdb->get_var('SELECT comment_ID FROM '$wpdb->comments' WHERE comment_author_IP = "'.$_SERVER["REMOTE_ADDR"].'" and comment_approved = "spam";');

    You closed the first part of the string and then didn't concatenate the variable. This is invalid php that will result in a fatal error. It should look something like the following.

    $myrows = $wpdb->get_var('SELECT comment_ID FROM '.$wpdb->comments.' WHERE comment_author_IP = "'.$_SERVER["REMOTE_ADDR"].'" and comment_approved = "spam";');

Leave a Reply