automattic / safe-report-comments Goto Github PK
View Code? Open in Web Editor NEWThis plugin gives your visitors the possibility to report a comment as inappropriate.
Home Page: https://wordpress.org/plugins/safe-report-comments/
This plugin gives your visitors the possibility to report a comment as inappropriate.
Home Page: https://wordpress.org/plugins/safe-report-comments/
Either a different hook (back compat risk), or better regex.
I note primarily because Twenty Twenty runs some code there that makes our regex not match. But it's unclear to the user that there's an issue and just looks broken.
We don't explicitly state it anywhere but it should be GPLv2.
I discovered this while working on #13. I believe I confirmed it's not a regression, but would welcome confirmation.
When re-flagging a comment, I do not get the expected "already flagged" message.
sfrc_flags
cookie value something like this eyIxOTAzMCI6MX0%3D
The problem is during unserialization
safe-report-comments/safe-report-comments.php
Lines 248 to 251 in d28439f
Problem one is the base64 decoding leaves a trailing character
wp> $base64 = base64_decode( 'eyIxOTAzMCI6MX0%3D' )
=> string(12) "{"19030":1}7"
Which then prevents json decoding
wp> json_decode( $base64 );
=> NULL
Because the data ends up as null (which is "cleaned" into an empty array), our comment isn't found in the data so is not considered "already flagged".
Note: It may be difficult to fully see this on the front-end due to the transients fallback. Conditional blocks at
safe-report-comments/safe-report-comments.php
Line 298 in d28439f
safe-report-comments/safe-report-comments.php
Line 346 in d28439f
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.