github: shadowy octopus with the head of a robot, emblazoned with the Dreamwidth swirl (Default)
github ([personal profile] github) wrote in [site community profile] changelog2020-09-07 02:29 pm

[dreamwidth/dw-free] c8e8ae: [#2841] Properly record anon comment IPs in the te...

Branch: refs/heads/master Home: https://github.com/dreamwidth/dw-free Commit: c8e8ae70f324c67b7794439f3706e8a7500740c4 https://github.com/dreamwidth/dw-free/commit/c8e8ae70f324c67b7794439f3706e8a7500740c4 Author: Nick Fagerlund nick.fagerlund@gmail.com Date: 2020-09-07 (Mon, 07 Sep 2020)

Changed paths: M cgi-bin/LJ/Talk.pm

Log Message:


[#2841] Properly record anon comment IPs in the temp table for spam

This is another instance of #2738 -- edit_comment and enter_comment used to mutate their $comment argument by adding a talkid key with the jtalkid, and I missed a few things referenced that value via the mutated hashref rather than one of their other handles to the jtalkid. In this case, it was preventing anonymous comment spam reports by not properly writing the IP address of new anon comments to the tempanonips table.

This time I hunted real hard for anything in the code that might access any hashref key called talkid. As a result, this commit also:

  • Fixes one more instance of That Thing (re-screening when editing).
  • Just deletes the final remaining instance (an unused hook).
  • Yanks a similar "mutate the $comment argument" behavior in enter_imported_comment -- nothing ever references that hashref argument again before it goes out of scope.

All the remaining hashrefs with talkid members seem to be either s2 comment objects or the parent element of one of prepare_and_validate_comment's comment hashrefs.