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:

The corresponding 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:

Reground sig:

The old patch:

My old sig:

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

5 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. +$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";');

  3. [...] first published and announced in #trilema last week but has since been reground to fit on top of hanbot's latest. Overall this patch proved to be an effective first step in mp-wp's healthy new lifestyle, [...]

Leave a Reply